I found a bug in the gem when trying to check for the existence of a key right after opening the database.
Here are examples of the bug, in the IRB console :
db = RocksDB.open("db/path")
db.exists?("user:adadada") # must return false
> true
db.get("user:adadada") # must return nil
> nil
db.exists?("user:adadada") # must return false
> false
But if before asking for the existence of the key, we do an each_key or other, db.exists? works well :
db = RocksDB.open("db/path")
db.each_key { |k| puts k }
db.exists?("user:adadada") # must return false
> false
I found a bug in the gem when trying to check for the existence of a key right after opening the database. Here are examples of the bug, in the IRB console :
But if before asking for the existence of the key, we do an
each_key
or other,db.exists?
works well :