get#

Look up a key; the value, or undef when the key is not stored.

Synopsis#

my $value = $txn->get($db, $key);

What you get back#

A copy of the value as a string (an integer in an MDB_INTEGERDUP database), or undef. In an MDB_DUPSORT database, the key’s first value.

Edge cases#

  • A key too long for the environment croaks with MDB_BAD_VALSIZE; maxkeysize gives the limit.

  • In a write transaction, it sees the transaction’s own writes.

See also#

  • get_view - the same without copying the value

  • Peta::LMDB::Cursor - walk keys in order, find a range