section 3valkey · Library functions 📚

395 pages · page 2 of 2

L (continued)

  • linsert(3valkey)Inserts an element before or after another element in a list.✨
  • llen(3valkey)Returns the length of a list.✨
  • lmove(3valkey)Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved.✨
  • lmpop(3valkey)Returns multiple elements from a list after removing them. Deletes the list if the last element was popped.✨
  • lolwut(3valkey)Displays computer art and the server version✨
  • lpop(3valkey)Returns and removes one or more elements from the beginning of a list. Deletes the list if the last element was popped.✨
  • lpos(3valkey)Returns the index of matching elements in a list.✨
  • lpush(3valkey)Prepends one or more elements to a list. Creates the key if it doesn’t exist.✨
  • lpushx(3valkey)Prepends one or more elements to a list only when the list exists.✨
  • lrange(3valkey)Returns a range of elements from a list.✨
  • lrem(3valkey)Removes elements from a list. Deletes the list if the last element was removed.✨
  • lset(3valkey)Sets the value of an element in a list by its index.✨
  • ltrim(3valkey)Removes elements from both ends a list. Deletes the list if all elements were trimmed.✨

M

O

P

Q

R

  • randomkey(3valkey)Returns a random key name from the database.✨
  • readonly(3valkey)Enables read-only queries for a connection to a Valkey replica node.✨
  • readwrite(3valkey)Enables read-write queries for a connection to a Valkey replica node.✨
  • rename(3valkey)Renames a key and overwrites the destination.✨
  • renamenx(3valkey)Renames a key only when the target key name doesn’t exist.✨
  • replconf(3valkey)An internal command for configuring the replication stream.✨
  • replicaof(3valkey)Configures a server as replica of another, or promotes it to a primary.✨
  • reset(3valkey)Resets the connection.✨
  • restore(3valkey)Creates a key from the serialized representation of a value.✨
  • restore-asking(3valkey)An internal command for migrating keys in a cluster.✨
  • role(3valkey)Returns the replication role.✨
  • rpop(3valkey)Returns and removes one or more elements from the end of a list. Deletes the list if the last element was popped.✨
  • rpoplpush(3valkey)Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped.✨
  • rpush(3valkey)Appends one or more elements to a list. Creates the key if it doesn’t exist.✨
  • rpushx(3valkey)Appends one or more elements to a list only when the list exists.✨

S

T

  • time(3valkey)Returns the server time.✨
  • touch(3valkey)Returns the number of existing keys out of those specified after updating the time they were last accessed.✨
  • ttl(3valkey)Returns the expiration time in seconds of a key.✨
  • type(3valkey)Determines the type of value stored at a key.✨

U

W

  • wait(3valkey)Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed.✨
  • waitaof(3valkey)Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the primary and/or replicas.✨
  • watch(3valkey)Monitors changes to keys to determine the execution of a transaction.✨

X

Z

  • zadd(3valkey)Adds one or more members to a sorted set, or updates their scores. Creates the key if it doesn’t exist.✨
  • zcard(3valkey)Returns the number of members in a sorted set.✨
  • zcount(3valkey)Returns the count of members in a sorted set that have scores within a range.✨
  • zdiff(3valkey)Returns the difference between multiple sorted sets.✨
  • zdiffstore(3valkey)Stores the difference of multiple sorted sets in a key.✨
  • zincrby(3valkey)Increments the score of a member in a sorted set.✨
  • zinter(3valkey)Returns the intersect of multiple sorted sets.✨
  • zintercard(3valkey)Returns the number of members of the intersect of multiple sorted sets.✨
  • zinterstore(3valkey)Stores the intersect of multiple sorted sets in a key.✨
  • zlexcount(3valkey)Returns the number of members in a sorted set within a lexicographical range.✨
  • zmpop(3valkey)Returns the highest- or lowest-scoring members from one or more sorted sets after removing them. Deletes the sorted set if the last member was popped.✨
  • zmscore(3valkey)Returns the score of one or more members in a sorted set.✨
  • zpopmax(3valkey)Returns the highest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped.✨
  • zpopmin(3valkey)Returns the lowest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped.✨
  • zrandmember(3valkey)Returns one or more random members from a sorted set.✨
  • zrange(3valkey)Returns members in a sorted set within a range of indexes.✨
  • zrangebylex(3valkey)Returns members in a sorted set within a lexicographical range.✨
  • zrangebyscore(3valkey)Returns members in a sorted set within a range of scores.✨
  • zrangestore(3valkey)Stores a range of members from sorted set in a key.✨
  • zrank(3valkey)Returns the index of a member in a sorted set ordered by ascending scores.✨
  • zrem(3valkey)Removes one or more members from a sorted set. Deletes the sorted set if all members were removed.✨
  • zremrangebylex(3valkey)Removes members in a sorted set within a lexicographical range. Deletes the sorted set if all members were removed.✨
  • zremrangebyrank(3valkey)Removes members in a sorted set within a range of indexes. Deletes the sorted set if all members were removed.✨
  • zremrangebyscore(3valkey)Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed.✨
  • zrevrange(3valkey)Returns members in a sorted set within a range of indexes in reverse order.✨
  • zrevrangebylex(3valkey)Returns members in a sorted set within a lexicographical range in reverse order.✨
  • zrevrangebyscore(3valkey)Returns members in a sorted set within a range of scores in reverse order.✨
  • zrevrank(3valkey)Returns the index of a member in a sorted set ordered by descending scores.✨
  • zscan(3valkey)Iterates over members and scores of a sorted set.✨
  • zscore(3valkey)Returns the score of a member in a sorted set.✨
  • zunion(3valkey)Returns the union of multiple sorted sets.✨
  • zunionstore(3valkey)Stores the union of multiple sorted sets in a key.✨