Currently to test if a key exists or not I use Get and then test if the Value is nil or not.
Does that mean we hit the value log every time or we only stay in the memtable and LSM ?
This is a useful feature. We can add it, so it won't go beyond LSM tree to figure this out.
Great !
How do you see the API for that ? adding an Exists method on the KV struct ?
Or put it on the KVItem ?
I can work on a PR since I'll need it for one of my project.
You can create a has function. Happy to accept a PR.
Sent from Nexus 6P
On Jun 17, 2017 9:05 AM, "Christophe de Carvalho" notifications@github.com
wrote:
Great !
How do you see the API for that ? adding an Exists method on the KV
struct ?
Or put it on the KVItem ?
I can work on a PR since I'll need it for one of my project.—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/dgraph-io/badger/issues/66#issuecomment-309223802,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABsyNB-j-gTyOgp80Wm7eXa08MAMbSzrks5sE_lBgaJpZM4N63I_
.
The 'Exists' function no longer exists (hah). Could this be added back or does it no longer make sense to have this feature?
You can do a get and if value is not found badger returns errKeynotfound. Earlier you had to fetch the value to determine if key exists or not. With the change in API exists is no longer needed since get doesn't go to value log.
Most helpful comment
You can do a get and if value is not found badger returns errKeynotfound. Earlier you had to fetch the value to determine if key exists or not. With the change in API exists is no longer needed since get doesn't go to value log.