PUT

Put a key/value pair in the database. It is added if needed; if the key already exists, it is updated.

Request

-----------------------------------------
| request | key length | key
-----------------------------------------
  1 byte    2 bytes      n bytes

-----------------------------------------
| data length | data
-----------------------------------------
  4 bytes       n bytes

Response

----------
| answer |
----------
  1 byte

Sync/async

The response is meaningful only for synchronous requests.

  • PUT: Can be synchronous or asynchronous.
  • ADD: Can be synchronous or asynchronous.
  • UPDATE: Synchronous only (not managed natively by LMDB, FineDB has to handle it using a transaction).