You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For context, I am using https://github.com/Level/classic-level/ but I decided to create this issue here because it should have value for all implementations.
Currently the best available method to test whether a record exists within the database for a particular key is to read the full value of the record using await db.get(key). You can instead iterate over db.keys(), but this is much slower.
It would be nice to have a more lightweight (and potentially even faster) method to assert the existence of a specific key like await db.has(key) which would return a boolean for whether a record exists with that key.
The text was updated successfully, but these errors were encountered:
For context, I am using https://github.com/Level/classic-level/ but I decided to create this issue here because it should have value for all implementations.
Currently the best available method to test whether a record exists within the database for a particular key is to read the full value of the record using
await db.get(key)
. You can instead iterate overdb.keys()
, but this is much slower.It would be nice to have a more lightweight (and potentially even faster) method to assert the existence of a specific key like
await db.has(key)
which would return aboolean
for whether a record exists with that key.The text was updated successfully, but these errors were encountered: