Level / abstract-level

Abstract class for a lexicographically sorted key-value database.
MIT License
128 stars 8 forks source link

How to check if KEY exists or alternatively check if VALUE exists in all keys #69

Closed unnaturalistic closed 1 year ago

unnaturalistic commented 1 year ago

how to check if a key exists or alternatively if a value exists in the database i am using nodejs and making an express app

vweevers commented 1 year ago

See https://github.com/Level/community/issues/106, which contains several ways to do it today, and a proposal for doing it with a new API that would have optimal performance.

As for checking whether a value exists, that doesn't fit in the key-centric design of level (or any key-value database). You would have to create an index so that you can lookup values (as keys).

unnaturalistic commented 1 year ago

thank you!