Hi dv,
According to liblmdb's terminology, an Env stands for a single mmap file, which in turn contains a number of DBs.
Here is some basic usage,
>> env, txn, db = mdb.mdb_write_handle('/tmp/mdb', 10*mdb.MB, 'sub-db1')
>> db.put(txn, 'key0', 'value0')
>> db.put(txn, 'key1', 'value1')
>> txn.commit()
Cursor is no longer frequently used since DB wraps most of the cursor manipulations.
>> env, txn, db = mdb.mdb_read_handle('/tmp/mdb', 'sub-db1')
>> db.get(txn, 'key') # get value for the given key
>> db.get_dup(txn, 'key') # get all duplicate values for the given key
>> db.get_lt(txn, 'key') # get all key/values whose key is less than the given key
>> db.get_le(txn, 'key') # get all key/values whose key is less or equal than the given key
>> db.mget(txn, ['key', 'key1']) # get values for a list of keys
>> db.items(txn) # traverse all key value pairs
>> txn.commit()
More examples are available here,
Hope this is helpful.
cheers,
Nan