According to the documentation (https://lmdb.readthedocs.org/en/release/), passing dupsort to open_db() should allow duplicate keys to be added to an lmdb database. But that seems to not be the case and it's still overwriting the values, unless I'm reading the documentation wrong.
env = lmdb.open(path.join(directory, 'lmdb'), map_size=map_size)
db = env.open_db(dupsort=True)
with env.begin(db=db, write=True) as transaction:
transaction.put(b'mykey', b'value1')
transaction.put(b'mykey', b'value2')
transaction.put(b'mykey', b'value3')
However, when I iterate through the key values, it only shows the last value "value3".
cursor = transaction.cursor()
for key, value in cursor.iternext(True, True):
print(key, value)
iternext_dup() also doesn't seem to be printing out the expected values. I also tried cursor.next() and it only return True once, additionally transaction.stat() shows entries: 1.