Closed kylebernhardy closed 3 years ago
This is because I made the default string encoding in del
be UTF-8, whereas putString
is doing UTF-16 encoding, and so putString
results in different binary data that doesn't match del
(whereas putUtf8
would match del
). I did this because lmdb-store prefers encoding strings as UTF-8 (using putUtf8 instead of putString), and that's the default handling raw strings, object serialization, etc. Of course del
, as inherited from node-lmdb is rather ambiguous in respect to value serialization and doesn't have all the type specific serializations of put{String|Binary|Boolean|Number|Utf}. I suppose I could make an explicit delUtf8
and revert the del
handling back to the node-lmdb for better back-compat.
No need for you to do anything, I can easily adjust our code as it is well centralized. Thank you for the insight, I will use putUtf8 / getCurrentUtf8
I am in process of migrating our code base from node-lmdb to lmdb-store and am currently using base level functionality to ease migration as that is what our current code base uses. I plan on using the worker thread transactions ultimately, but in our current code I noticed that entries don't delete on dupsorted dbis. I did verify this does work for the store.remove & does work in node-lmdb, also non-dupsorted dbis remove correctly. See code below:
generated output is:
No entries from the dupsorted dbi are removed.