Replies: 3 comments 12 replies
-
Also, is it possible to expose I tried using the npm package (pure JS one) but it doesn't actually encode arrays? |
Beta Was this translation helpful? Give feedback.
-
I generally do something like this:
The highest bytes in ordered-binary are UTF-8, which can't have a first byte higher than 239. You could probably also safely use As far as exposing |
Beta Was this translation helpful? Give feedback.
-
Another question related to The use-case is rather simple - imagine a secondary index similar to compound MongoDB index: We don't have a way to apply custom key comparators but I guess we can at least invert binary values when inserting? But that requires messing with |
Beta Was this translation helpful? Give feedback.
-
We are using arrays of JS primitives as keys for composite indexes and it works nice (ordered-binary is pretty cool!).
But now what we need is to run range queries. Does
ordered binary
has some special values that are "guaranteed to be before any other value" or "guaranteed to be after any other value"?We can workaround this for "before" case using
Symbols
but is there a better alternative? Basically, some value that is never stored inlmdb-store
keys but could be used in range queries to indicate the min/max possible binary value?Example:
Then run something like this:
to get all items starting with
[2]
?Beta Was this translation helpful? Give feedback.
All reactions