DB.get

Gets an entry from the DB

Only accepts an array for the key. V must be convertable from char array.

class DB
bool
get
(
T
V
)
(
in T key
,
out V value
,)
if (
!is(V == interface)
)

Return Value

Type: bool

true if the key was found in the DB

Throws

LeveldbException

Examples

auto opt = new Options;
opt.create_if_missing = true;
auto db = new DB(opt, "/my/db/");
db.put("User1", Slice("John Doe"));
string name;
enforce(db.get("User1", name));
assert(name == "John Doe");

Meta