kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
505 stars 41 forks source link

N00b question: how do I update a value? #103

Closed cekvenich2 closed 2 years ago

cekvenich2 commented 2 years ago

I want no dupe keys.

I want to update the value for a key. Do I have to remove the key first?

kriszyp commented 2 years ago

No, you do not have to remove the key first. By default, there are no duplicate keys, so just do a db.put(key, value) and it will update/replace the value for that key (as long as you are not using dupSort: true, which is what would enable duplicate keys).

cekvenich2 commented 2 years ago

Perfect. THX!