Keys

Commands that work on any key, whatever its type: whether it exists, deleting and renaming it, when it expires, its type, and walking the keyspace.

32 commands in KiviDB 1.2.0. Every command.

  • COPY: Copies the value at source to destination, with its expiry.
  • DEL: Deletes the given keys, whatever their type, and returns how many it deleted.
  • DUMP: Serializes the value at key into a payload that RESTORE turns back into the value.
  • EXISTS: Returns how many of the given keys exist.
  • EXPIRE: Makes key expire after seconds.
  • EXPIREAT: Makes key expire at a Unix time, in seconds.
  • EXPIRETIME: Returns the Unix time, in seconds, at which key expires.
  • KEYS: Returns every key of the current database that matches a glob-style pattern.
  • MOVE: Moves key to database db.
  • OBJECT: OBJECT is a container: its subcommands report on a single key's value, and on how the key has been used.
    • OBJECT ENCODING: Returns the name of the encoding Redis would use for the value at key, from the value's size and the *-max-listpack-* and set-max-intset-entries settings.
    • OBJECT FREQ: Returns the key's use count: a number that grows with how often the key is used, logarithmically, and falls with time, as Redis's LFU counter does.
    • OBJECT HELP: Lists the OBJECT subcommands, each with a line or two on what it does.
    • OBJECT IDLETIME: Returns how many seconds ago key was last read or written.
    • OBJECT REFCOUNT: Returns how many references there are to the value stored at key.
  • PERSIST: Removes the expiry of key, so that it is kept until deleted.
  • PEXPIRE: Makes key expire after milliseconds.
  • PEXPIREAT: Makes key expire at a Unix time, in milliseconds.
  • PEXPIRETIME: Returns the Unix time, in milliseconds, at which key expires.
  • PTTL: Returns how long key has left before it expires, in milliseconds.
  • RANDOMKEY: Returns the name of a key of the current database, picked at random, or nil if the database has no keys.
  • RENAME: Renames source to destination, with its expiry.
  • RENAMENX: Renames source to destination only if destination does not exist.
  • RESTORE: Creates key from a DUMP payload.
  • SCAN: Goes through the keys of the current database a page at a time.
  • SORT: Sorts the elements of a list, set or sorted set, as numbers unless ALPHA is given.
  • SORT_RO: SORT without STORE: it only reads, so it can be sent to a read-only replica.
  • SWAPDB: Swaps the contents of two databases in one step: every key, with its value and its time to live, moves from db1 to db2 and the other way round.
  • TOUCH: Marks the given keys as used, and returns how many of them exist.
  • TTL: Returns how long key has before it expires, in seconds.
  • TYPE: Returns the type of the value at key.
  • UNLINK: Deletes the given keys, like DEL, but frees large values in the background.