Skip to content
Browse files

gofmt

  • Loading branch information...
1 parent 96613d0 commit 3be09ec5e438250a03278ebbb9cc0dc7eabc9562 Simon Zimmermann committed Mar 27, 2011
Showing with 144 additions and 144 deletions.
  1. +123 −123 commands.go
  2. +21 −21 redoc.go
View
246 commands.go
@@ -2,8 +2,8 @@ package main
// This file is auto-generated by ./update
-var Commands = map[string]Command {
- "exists": {"exists", "Determine if a key exists", "key", "generic", "0.07", `@complexity
+var Commands = map[string]Command{
+ "exists": {"exists", "Determine if a key exists", "key", "generic", "0.07", `@complexity
O(1)
@@ -23,7 +23,7 @@ Returns if 'key' exists.
SET key1 "Hello"
EXISTS key1
EXISTS key2`},
- "mset": {"mset", "Set multiple keys to multiple values", "key value [key value ...]", "string", "1.001", `@complexity
+ "mset": {"mset", "Set multiple keys to multiple values", "key value [key value ...]", "string", "1.001", `@complexity
O(N) where N is the number of keys to set
@@ -45,7 +45,7 @@ clients to see that some of the keys were updated while others are unchanged.
MSET key1 "Hello" key2 "World"
GET key1
GET key2`},
- "zunionstore": {"zunionstore", "Add multiple sorted sets and store the resulting sorted set in a new key", "destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]", "sorted_set", "1.3.10", `@complexity
+ "zunionstore": {"zunionstore", "Add multiple sorted sets and store the resulting sorted set in a new key", "destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]", "sorted_set", "1.3.10", `@complexity
O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets,
and M being the number of elements in the resulting sorted set.
@@ -87,7 +87,7 @@ If 'destination' already exists, it is overwritten.
ZADD zset2 3 "three"
ZUNIONSTORE out 2 zset1 zset2 WEIGHTS 2 3
ZRANGE out 0 -1 WITHSCORES`},
- "expire": {"expire", "Set a key's time to live in seconds", "key seconds", "generic", "0.09", `@complexity
+ "expire": {"expire", "Set a key's time to live in seconds", "key seconds", "generic", "0.09", `@complexity
O(1)
@@ -117,7 +117,7 @@ for more information.
SET mykey "Hello"
EXPIRE mykey 10
TTL mykey`},
- "hsetnx": {"hsetnx", "Set the value of a hash field, only if the field does not exist", "key field value", "hash", "1.3.8", `@complexity
+ "hsetnx": {"hsetnx", "Set the value of a hash field, only if the field does not exist", "key field value", "hash", "1.3.8", `@complexity
O(1)
@@ -139,7 +139,7 @@ yet exist. If 'key' does not exist, a new key holding a hash is created. If
HSETNX myhash field "Hello"
HSETNX myhash field "World"
HGET myhash field`},
- "hdel": {"hdel", "Delete a hash field", "key field", "hash", "1.3.10", `@complexity
+ "hdel": {"hdel", "Delete a hash field", "key field", "hash", "1.3.10", `@complexity
O(1)
@@ -159,7 +159,7 @@ Removes 'field' from the hash stored at 'key'.
HSET myhash field1 "foo"
HDEL myhash field1
HDEL myhash field2`},
- "srandmember": {"srandmember", "Get a random member from a set", "key", "set", "1.001", `@complexity
+ "srandmember": {"srandmember", "Get a random member from a set", "key", "set", "1.001", `@complexity
O(1)
@@ -180,7 +180,7 @@ selected element.
SADD myset "two"
SADD myset "three"
SRANDMEMBER myset`},
- "smove": {"smove", "Move a member from one set to another", "source destination member", "set", "0.091", `@complexity
+ "smove": {"smove", "Move a member from one set to another", "source destination member", "set", "0.091", `@complexity
O(1)
@@ -213,12 +213,12 @@ An error is returned if 'source' or 'destination' does not hold a set value.
SMOVE myset myotherset "two"
SMEMBERS myset
SMEMBERS myotherset`},
- "flushdb": {"flushdb", "Remove all keys from the current database", "-", "server", "0.07", `Delete all the keys of the currently selected DB. This command never fails.
+ "flushdb": {"flushdb", "Remove all keys from the current database", "-", "server", "0.07", `Delete all the keys of the currently selected DB. This command never fails.
@return
@status-reply`},
- "srem": {"srem", "Remove a member from a set", "key member", "set", "0.07", `@complexity
+ "srem": {"srem", "Remove a member from a set", "key member", "set", "0.07", `@complexity
O(1)
@@ -244,15 +244,15 @@ An error is returned when the value stored at 'key' is not a set.
SREM myset "one"
SREM myset "four"
SMEMBERS myset`},
- "bgsave": {"bgsave", "Asynchronously save the dataset to disk", "-", "server", "0.07", `Save the DB in background. The OK code is immediately returned.
+ "bgsave": {"bgsave", "Asynchronously save the dataset to disk", "-", "server", "0.07", `Save the DB in background. The OK code is immediately returned.
Redis forks, the parent continues to server the clients, the child
saves the DB on disk then exit. A client my be able to check if the
operation succeeded using the 'LASTSAVE' command.
@return
@status-reply`},
- "brpoplpush": {"brpoplpush", "Pop a value from a list, push it to another list and return it; or block until one is available", "source destination timeout", "list", "2.1.7", `@complexity
+ "brpoplpush": {"brpoplpush", "Pop a value from a list, push it to another list and return it; or block until one is available", "source destination timeout", "list", "2.1.7", `@complexity
O(1).
@@ -268,7 +268,7 @@ See 'RPOPLPUSH' for more information.
@bulk-reply: the element being popped from 'source' and pushed to
'destination'. If 'timeout' is reached, a @nil-reply is returned.`},
- "lindex": {"lindex", "Get an element from a list by its index", "key index", "list", "0.07", `@complexity
+ "lindex": {"lindex", "Get an element from a list by its index", "key index", "list", "0.07", `@complexity
O(N) where N is the number of elements to traverse to get to the element
at 'index'. This makes asking for the first or the last
@@ -294,7 +294,7 @@ When the value at 'key' is not a list, an error is returned.
LINDEX mylist 0
LINDEX mylist -1
LINDEX mylist 3`},
- "hexists": {"hexists", "Determine if a hash field exists", "key field", "hash", "1.3.10", `@complexity
+ "hexists": {"hexists", "Determine if a hash field exists", "key field", "hash", "1.3.10", `@complexity
O(1)
@@ -314,7 +314,7 @@ Returns if 'field' is an existing field in the hash stored at 'key'.
HSET myhash field1 "foo"
HEXISTS myhash field1
HEXISTS myhash field2`},
- "zrange": {"zrange", "Return a range of members in a sorted set, by index", "key start stop [WITHSCORES]", "sorted_set", "1.1", `@complexity
+ "zrange": {"zrange", "Return a range of members in a sorted set, by index", "key start stop [WITHSCORES]", "sorted_set", "1.1", `@complexity
O(log(N)+M) with N being the number of elements in the sorted set and M the
number of elements returned.
@@ -356,7 +356,7 @@ their scores).
ZRANGE myzset 0 -1
ZRANGE myzset 2 3
ZRANGE myzset -2 -1`},
- "setbit": {"setbit", "Sets or clears the bit at offset in the string value stored at key", "key offset value", "string", "2.1.8", `@complexity
+ "setbit": {"setbit", "Sets or clears the bit at offset in the string value stored at key", "key offset value", "string", "2.1.8", `@complexity
O(1)
@@ -390,7 +390,7 @@ _key_ will not have the allocation overhead.
SETBIT mykey 7 1
SETBIT mykey 7 0
GET mykey`},
- "getbit": {"getbit", "Returns the bit value at offset in the string value stored at key", "key offset", "string", "2.1.8", `@complexity
+ "getbit": {"getbit", "Returns the bit value at offset in the string value stored at key", "key offset", "string", "2.1.8", `@complexity
O(1)
@@ -413,7 +413,7 @@ to be a contiguous space with 0 bits.
GETBIT mykey 0
GETBIT mykey 7
GETBIT mykey 100`},
- "watch": {"watch", "Watch the given keys to determine execution of the MULTI/EXEC block", "key [key ...]", "transactions", "2.1.0", `@complexity
+ "watch": {"watch", "Watch the given keys to determine execution of the MULTI/EXEC block", "key [key ...]", "transactions", "2.1.0", `@complexity
O(1) for every key.
@@ -422,7 +422,7 @@ Marks the given keys to be watched for conditional execution of a [transaction](
@return
@status-reply: always 'OK'.`},
- "keys": {"keys", "Find all keys matching the given pattern", "pattern", "generic", "0.07", `@complexity
+ "keys": {"keys", "Find all keys matching the given pattern", "pattern", "generic", "0.07", `@complexity
O(N) with N being the number of keys in the database, under the assumption that
the key names in the database and the given pattern have limited length.
@@ -459,7 +459,7 @@ Use '\' to escape special characters if you want to match them verbatim.
KEYS *o*
KEYS t??
KEYS *`},
- "randomkey": {"randomkey", "Return a random key from the keyspace", "-", "generic", "0.07", `@complexity
+ "randomkey": {"randomkey", "Return a random key from the keyspace", "-", "generic", "0.07", `@complexity
O(1)
@@ -469,7 +469,7 @@ Return a random key from the currently selected database.
@return
@bulk-reply: the random key, or 'nil' when the database is empty.`},
- "lpop": {"lpop", "Remove and get the first element in a list", "key", "list", "0.07", `@complexity
+ "lpop": {"lpop", "Remove and get the first element in a list", "key", "list", "0.07", `@complexity
O(1)
@@ -488,7 +488,7 @@ Removes and returns the first element of the list stored at 'key'.
RPUSH mylist "three"
LPOP mylist
LRANGE mylist 0 -1`},
- "sadd": {"sadd", "Add a member to a set", "key member", "set", "0.07", `@complexity
+ "sadd": {"sadd", "Add a member to a set", "key member", "set", "0.07", `@complexity
O(1)
@@ -513,12 +513,12 @@ An error is returned when the value stored at 'key' is not a set.
SADD myset "World"
SADD myset "World"
SMEMBERS myset`},
- "dbsize": {"dbsize", "Return the number of keys in the selected database", "-", "server", "0.07", `Return the number of keys in the currently selected database.
+ "dbsize": {"dbsize", "Return the number of keys in the selected database", "-", "server", "0.07", `Return the number of keys in the currently selected database.
@return
@integer-reply`},
- "rpushx": {"rpushx", "Append a value to a list, only if the list exists", "key value", "list", "2.1.1", `@complexity
+ "rpushx": {"rpushx", "Append a value to a list, only if the list exists", "key value", "list", "2.1.1", `@complexity
O(1)
@@ -539,7 +539,7 @@ be performed when 'key' does not yet exist.
RPUSHX myotherlist "World"
LRANGE mylist 0 -1
LRANGE myotherlist 0 -1`},
- "zremrangebyscore": {"zremrangebyscore", "Remove all members in a sorted set within the given scores", "key min max", "sorted_set", "1.1", `@complexity
+ "zremrangebyscore": {"zremrangebyscore", "Remove all members in a sorted set within the given scores", "key min max", "sorted_set", "1.1", `@complexity
O(log(N)+M) with N being the number of elements in the sorted set and M the
number of elements removed by the operation.
@@ -562,14 +562,14 @@ Since version 2.1.6, 'min' and 'max' can be exclusive, following the syntax of
ZADD myzset 3 "three"
ZREMRANGEBYSCORE myzset -inf (2
ZRANGE myzset 0 -1 WITHSCORES`},
- "bgrewriteaof": {"bgrewriteaof", "Asynchronously rewrite the append-only file", "-", "server", "1.07", `Rewrites the [append-only file](/topics/persistence#append-only-file) to reflect the current dataset in memory.
+ "bgrewriteaof": {"bgrewriteaof", "Asynchronously rewrite the append-only file", "-", "server", "1.07", `Rewrites the [append-only file](/topics/persistence#append-only-file) to reflect the current dataset in memory.
If 'BGREWRITEAOF' fails, no data gets lost as the old AOF will be untouched.
@return
@status-reply: always 'OK'.`},
- "unwatch": {"unwatch", "Forget about all watched keys", "-", "transactions", "2.1.0", `@complexity
+ "unwatch": {"unwatch", "Forget about all watched keys", "-", "transactions", "2.1.0", `@complexity
O(1).
@@ -580,7 +580,7 @@ If you call 'EXEC' or 'DISCARD', there's no need to manually call 'UNWATCH'.
@return
@status-reply: always 'OK'.`},
- "lpush": {"lpush", "Prepend a value to a list", "key value", "list", "0.07", `@complexity
+ "lpush": {"lpush", "Prepend a value to a list", "key value", "list", "0.07", `@complexity
O(1)
@@ -599,7 +599,7 @@ When 'key' holds a value that is not a list, an error is returned.
LPUSH mylist "World"
LPUSH mylist "Hello"
LRANGE mylist 0 -1`},
- "append": {"append", "Append a value to a key", "key value", "string", "1.3.3", `@complexity
+ "append": {"append", "Append a value to a key", "key value", "string", "1.3.3", `@complexity
O(1). The amortized time complexity is O(1) assuming the appended value is
small and the already present value is of any size, since the dynamic string
@@ -621,7 +621,7 @@ empty string, so 'APPEND' will be similar to 'SET' in this special case.
APPEND mykey "Hello"
APPEND mykey " World"
GET mykey`},
- "zincrby": {"zincrby", "Increment the score of a member in a sorted set", "key increment member", "sorted_set", "1.1", `@complexity
+ "zincrby": {"zincrby", "Increment the score of a member in a sorted set", "key increment member", "sorted_set", "1.1", `@complexity
O(log(N)) where N is the number of elements in the sorted set.
@@ -649,7 +649,7 @@ number), represented as string.
ZADD myzset 2 "two"
ZINCRBY myzset 2 "one"
ZRANGE myzset 0 -1 WITHSCORES`},
- "zrevrank": {"zrevrank", "Determine the index of a member in a sorted set, with scores ordered from high to low", "key member", "sorted_set", "1.3.4", `@complexity
+ "zrevrank": {"zrevrank", "Determine the index of a member in a sorted set, with scores ordered from high to low", "key member", "sorted_set", "1.3.4", `@complexity
O(log(N))
@@ -675,7 +675,7 @@ high.
ZADD myzset 3 "three"
ZREVRANK myzset "one"
ZREVRANK myzset "four"`},
- "scard": {"scard", "Get the number of members in a set", "key", "set", "0.07", `@complexity
+ "scard": {"scard", "Get the number of members in a set", "key", "set", "0.07", `@complexity
O(1)
@@ -693,7 +693,7 @@ Returns the set cardinality (number of elements) of the set stored at 'key'.
SADD myset "Hello"
SADD myset "World"
SCARD myset`},
- "zrevrangebyscore": {"zrevrangebyscore", "Return a range of members in a sorted set, by score, with scores ordered from high to low", "key max min [WITHSCORES] [LIMIT offset count]", "sorted_set", "2.1.6", `@complexity
+ "zrevrangebyscore": {"zrevrangebyscore", "Return a range of members in a sorted set, by score, with scores ordered from high to low", "key max min [WITHSCORES] [LIMIT offset count]", "sorted_set", "2.1.6", `@complexity
O(log(N)+M) with N being the number of elements in the sorted set and M the
number of elements being returned. If M is constant (e.g. always asking for the
@@ -724,7 +724,7 @@ their scores).
ZREVRANGEBYSCORE myzset 2 1
ZREVRANGEBYSCORE myzset 2 (1
ZREVRANGEBYSCORE myzset (2 (1`},
- "ltrim": {"ltrim", "Trim a list to the specified range", "key start stop", "list", "0.07", `@complexity
+ "ltrim": {"ltrim", "Trim a list to the specified range", "key start stop", "list", "0.07", `@complexity
O(N) where N is the number of elements to be removed by the operation.
@@ -767,7 +767,7 @@ element is removed from the tail of the list.
RPUSH mylist "three"
LTRIM mylist 1 -1
LRANGE mylist 0 -1`},
- "hkeys": {"hkeys", "Get all the fields in a hash", "key", "hash", "1.3.10", `@complexity
+ "hkeys": {"hkeys", "Get all the fields in a hash", "key", "hash", "1.3.10", `@complexity
O(N) where N is the size of the hash.
@@ -784,7 +784,7 @@ not exist.
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HKEYS myhash`},
- "zremrangebyrank": {"zremrangebyrank", "Remove all members in a sorted set within the given indexes", "key start stop", "sorted_set", "1.3.4", `@complexity
+ "zremrangebyrank": {"zremrangebyrank", "Remove all members in a sorted set within the given indexes", "key start stop", "sorted_set", "1.3.4", `@complexity
O(log(N)+M) with N being the number of elements in the sorted set and M the
number of elements removed by the operation.
@@ -808,7 +808,7 @@ second highest score and so forth.
ZADD myzset 3 "three"
ZREMRANGEBYRANK myzset 0 1
ZRANGE myzset 0 -1 WITHSCORES`},
- "config resetstat": {"config resetstat", "Reset the stats returned by INFO", "-", "server", "2.0", `@complexity
+ "config resetstat": {"config resetstat", "Reset the stats returned by INFO", "-", "server", "2.0", `@complexity
O(1).
@@ -825,7 +825,7 @@ These are the counters that are reset:
@return
@status-reply: always 'OK'.`},
- "lset": {"lset", "Set the value of an element in a list by its index", "key index value", "list", "0.07", `@complexity
+ "lset": {"lset", "Set the value of an element in a list by its index", "key index value", "list", "0.07", `@complexity
O(N) where N is the length of the list. Setting either the first or the last
element of the list is O(1).
@@ -848,7 +848,7 @@ An error is returned for out of range indexes.
LSET mylist 0 "four"
LSET mylist -2 "five"
LRANGE mylist 0 -1`},
- "move": {"move", "Move a key to another database", "key db", "generic", "0.07", `@complexity
+ "move": {"move", "Move a key to another database", "key db", "generic", "0.07", `@complexity
O(1)
@@ -864,7 +864,7 @@ use 'MOVE' as a locking primitive because of this.
* '1' if 'key' was moved.
* '0' if 'key' was not moved.`},
- "getset": {"getset", "Set the string value of a key and return its old value", "key value", "string", "0.091", `@complexity
+ "getset": {"getset", "Set the string value of a key and return its old value", "key value", "string", "0.091", `@complexity
O(1)
@@ -894,7 +894,7 @@ reset it to zero atomically. This can be done using 'GETSET mycounter "0"':
SET mykey "Hello"
GETSET mykey "World"
GET mykey`},
- "set": {"set", "Set the string value of a key", "key value", "string", "0.07", `@complexity
+ "set": {"set", "Set the string value of a key", "key value", "string", "0.07", `@complexity
O(1)
@@ -911,7 +911,7 @@ overwritten, regardless of its type.
@cli
SET mykey "Hello"
GET mykey`},
- "del": {"del", "Delete a key", "key [key ...]", "generic", "0.07", `@complexity
+ "del": {"del", "Delete a key", "key [key ...]", "generic", "0.07", `@complexity
O(N) where N is the number of keys that will be removed. When a key to remove
holds a value other than a string, the individual complexity for this key is
@@ -930,7 +930,7 @@ Removes the specified keys. A key is ignored if it does not exist.
SET key1 "Hello"
SET key2 "World"
DEL key1 key2 key3`},
- "strlen": {"strlen", "Get the length of the value stored in a key", "key", "string", "2.1.2", `@complexity
+ "strlen": {"strlen", "Get the length of the value stored in a key", "key", "string", "2.1.2", `@complexity
O(1)
@@ -948,7 +948,7 @@ An error is returned when 'key' holds a non-string value.
SET mykey "Hello world"
STRLEN mykey
STRLEN nonexisting`},
- "zrem": {"zrem", "Remove a member from a sorted set", "key member", "sorted_set", "1.1", `@complexity
+ "zrem": {"zrem", "Remove a member from a sorted set", "key member", "sorted_set", "1.1", `@complexity
O(log(N)) with N being the number of elements in the sorted set.
@@ -972,7 +972,7 @@ An error is returned when 'key' exists and does not hold a sorted set.
ZADD myzset 3 "three"
ZREM myzset "two"
ZRANGE myzset 0 -1 WITHSCORES`},
- "sunionstore": {"sunionstore", "Add multiple sets and store the resulting set in a key", "destination key [key ...]", "set", "0.091", `@complexity
+ "sunionstore": {"sunionstore", "Add multiple sets and store the resulting set in a key", "destination key [key ...]", "set", "0.091", `@complexity
O(N) where N is the total number of elements in all given sets.
@@ -984,7 +984,7 @@ If 'destination' already exists, it is overwritten.
@return
@integer-reply: the number of elements in the resulting set.`},
- "persist": {"persist", "Remove the expiration from a key", "key", "generic", "2.1.2", `@complexity
+ "persist": {"persist", "Remove the expiration from a key", "key", "generic", "2.1.2", `@complexity
O(1)
@@ -1006,14 +1006,14 @@ Remove the existing timeout on 'key'.
TTL mykey
PERSIST mykey
TTL mykey`},
- "config get": {"config get", "Get the value of a configuration parameter", "parameter", "server", "2.0", `@complexity
+ "config get": {"config get", "Get the value of a configuration parameter", "parameter", "server", "2.0", `@complexity
@description
@examples
@return`},
- "sinter": {"sinter", "Intersect multiple sets", "key [key ...]", "set", "0.07", `@complexity
+ "sinter": {"sinter", "Intersect multiple sets", "key [key ...]", "set", "0.07", `@complexity
O(N\*M) worst case where N is the cardinality of the smallest set and M is the
number of sets.
@@ -1046,7 +1046,7 @@ with an empty set always results in an empty set).
SADD key2 "d"
SADD key2 "e"
SINTER key1 key2`},
- "renamenx": {"renamenx", "Rename a key, only if the new key does not exist", "key newkey", "generic", "0.07", `@complexity
+ "renamenx": {"renamenx", "Rename a key, only if the new key does not exist", "key newkey", "generic", "0.07", `@complexity
O(1)
@@ -1068,7 +1068,7 @@ It returns an error under the same conditions as 'RENAME'.
SET myotherkey "World"
RENAMENX mykey myotherkey
GET myotherkey`},
- "sismember": {"sismember", "Determine if a given value is a member of a set", "key member", "set", "0.07", `@complexity
+ "sismember": {"sismember", "Determine if a given value is a member of a set", "key member", "set", "0.07", `@complexity
O(1)
@@ -1088,7 +1088,7 @@ Returns if 'member' is a member of the set stored at 'key'.
SADD myset "one"
SISMEMBER myset "one"
SISMEMBER myset "two"`},
- "rename": {"rename", "Rename a key", "key newkey", "generic", "0.07", `@complexity
+ "rename": {"rename", "Rename a key", "key newkey", "generic", "0.07", `@complexity
O(1)
@@ -1107,7 +1107,7 @@ is overwritten.
SET mykey "Hello"
RENAME mykey myotherkey
GET myotherkey`},
- "hgetall": {"hgetall", "Get all the fields and values in a hash", "key", "hash", "1.3.10", `@complexity
+ "hgetall": {"hgetall", "Get all the fields and values in a hash", "key", "hash", "1.3.10", `@complexity
O(N) where N is the size of the hash.
@@ -1126,7 +1126,7 @@ empty list when 'key' does not exist.
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HGETALL myhash`},
- "zcount": {"zcount", "Count the members in a sorted set with scores within the given values", "key min max", "sorted_set", "1.3.3", `@complexity
+ "zcount": {"zcount", "Count the members in a sorted set with scores within the given values", "key min max", "sorted_set", "1.3.3", `@complexity
O(log(N)+M) with N being the number of elements in the
sorted set and M being the number of elements between 'min' and 'max'.
@@ -1149,7 +1149,7 @@ for 'ZRANGEBYSCORE'.
ZADD myzset 3 "three"
ZCOUNT myzset -inf +inf
ZCOUNT myzset (1 3`},
- "mget": {"mget", "Get the values of all the given keys", "key [key ...]", "string", "0.07", `@complexity
+ "mget": {"mget", "Get the values of all the given keys", "key [key ...]", "string", "0.07", `@complexity
O(N) where N is the number of keys to retrieve
@@ -1168,7 +1168,7 @@ Because of this, the operation never fails.
SET key1 "Hello"
SET key2 "World"
MGET key1 key2 nonexisting`},
- "subscribe": {"subscribe", "Listen for messages published to the given channels", "channel [channel ...]", "pubsub", "1.3.8", `@complexity
+ "subscribe": {"subscribe", "Listen for messages published to the given channels", "channel [channel ...]", "pubsub", "1.3.8", `@complexity
O(N) where N is the number of channels to subscribe to.
@@ -1177,7 +1177,7 @@ Subscribes the client to the specified channels.
Once the client enters the subscripted state it is not supposed to issue
any other commands, expect for additional 'SUBSCRIBE', 'PSUBSCRIBE',
'UNSUBSCRIBE' and 'PUNSUBSCRIBE' commands.`},
- "publish": {"publish", "Post a message to a channel", "channel message", "pubsub", "1.3.8", `@complexity
+ "publish": {"publish", "Post a message to a channel", "channel message", "pubsub", "1.3.8", `@complexity
O(N+M) where N is the number of clients subscribed to the receiving
channel and M is the total number of subscribed patterns (by any
@@ -1188,7 +1188,7 @@ Posts a message to the given channel.
@return
@integer-reply: the number of clients that received the message.`},
- "rpoplpush": {"rpoplpush", "Remove the last element in a list, append it to another list and return it", "source destination", "list", "1.1", `@complexity
+ "rpoplpush": {"rpoplpush", "Remove the last element in a list, append it to another list and return it", "source destination", "list", "1.1", `@complexity
O(1)
@@ -1244,7 +1244,7 @@ visit all the elements of an N-elements list in O(N) without transferring
the full list from the server to the client in a single 'LRANGE' operation.
Note that a process can traverse the list even while other processes
are actively 'RPUSH'-ing against the list, and still no element will be skipped.`},
- "brpop": {"brpop", "Remove and get the last element in a list, or block until one is available", "key [key ...] timeout", "list", "1.3.1", `@complexity
+ "brpop": {"brpop", "Remove and get the last element in a list, or block until one is available", "key [key ...] timeout", "list", "1.3.1", `@complexity
O(1)
@@ -1264,7 +1264,7 @@ from popping from the tail of a list instead of the head of a list.
* A 'nil' multi-bulk when no element could be popped and the timeout expired.
* A two-element multi-bulk with the first element being the name of the key where an element
was popped and the second element being the value of the popped element.`},
- "expireat": {"expireat", "Set the expiration for a key as a UNIX timestamp", "key timestamp", "generic", "1.1", `@complexity
+ "expireat": {"expireat", "Set the expiration for a key as a UNIX timestamp", "key timestamp", "generic", "1.1", `@complexity
O(1)
@@ -1299,7 +1299,7 @@ specify that a given key should expire at a given time in the future.
EXISTS mykey
EXPIREAT mykey 1293840000
EXISTS mykey`},
- "sort": {"sort", "Sort the elements in a list, set or sorted set", "key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]", "generic", "0.07", `@complexity
+ "sort": {"sort", "Sort the elements in a list, set or sorted set", "key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]", "generic", "0.07", `@complexity
O(N+M\*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is currently O(N) as there is a copy step that will be avoided in next releases.
@@ -1411,14 +1411,14 @@ resulting key is accessed to retrieve the specified hash field.
@return
@multi-bulk-reply: list of sorted elements.`},
- "debug segfault": {"debug segfault", "Make the server crash", "-", "server", "0.101", `@complexity
+ "debug segfault": {"debug segfault", "Make the server crash", "-", "server", "0.101", `@complexity
@description
@examples
@return`},
- "sdiff": {"sdiff", "Subtract multiple sets", "key [key ...]", "set", "0.100", `@complexity
+ "sdiff": {"sdiff", "Subtract multiple sets", "key [key ...]", "set", "0.100", `@complexity
O(N) where N is the total number of elements in all given sets.
@@ -1448,7 +1448,7 @@ Keys that do not exist are considered to be empty sets.
SADD key2 "d"
SADD key2 "e"
SDIFF key1 key2`},
- "linsert": {"linsert", "Insert an element before or after another element in a list", "key BEFORE|AFTER pivot value", "list", "2.1.1", `@complexity
+ "linsert": {"linsert", "Insert an element before or after another element in a list", "key BEFORE|AFTER pivot value", "list", "2.1.1", `@complexity
O(N) where N is the number of elements to traverse before seeing the value
'pivot'. This means that inserting somewhere on the left end on the list (head)
@@ -1474,7 +1474,7 @@ the value 'pivot' was not found.
RPUSH mylist "World"
LINSERT mylist BEFORE "World" "There"
LRANGE mylist 0 -1`},
- "incr": {"incr", "Increment the integer value of a key by one", "key", "string", "0.07", `@complexity
+ "incr": {"incr", "Increment the integer value of a key by one", "key", "string", "0.07", `@complexity
O(1)
@@ -1502,7 +1502,7 @@ string representation of the integer.
SET mykey "10"
INCR mykey
GET mykey`},
- "hlen": {"hlen", "Get the number of fields in a hash", "key", "hash", "1.3.10", `@complexity
+ "hlen": {"hlen", "Get the number of fields in a hash", "key", "hash", "1.3.10", `@complexity
O(1)
@@ -1519,7 +1519,7 @@ Returns the number of fields contained in the hash stored at 'key'.
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HLEN myhash`},
- "auth": {"auth", "Authenticate to the server", "password", "connection", "0.08", `@description
+ "auth": {"auth", "Authenticate to the server", "password", "connection", "0.08", `@description
Request for authentication in a password protected Redis server.
Redis can be instructed to require a password before allowing clients
@@ -1537,12 +1537,12 @@ a strong and very long password so that this attack is infeasible.
@return
@status-reply`},
- "psubscribe": {"psubscribe", "Listen for messages published to channels matching the given patterns", "pattern [pattern ...]", "pubsub", "1.3.8", `@complexity
+ "psubscribe": {"psubscribe", "Listen for messages published to channels matching the given patterns", "pattern [pattern ...]", "pubsub", "1.3.8", `@complexity
O(N) where N is the number of patterns the client is already subscribed to.
Subscribes the client to the given patterns.`},
- "zrank": {"zrank", "Determine the index of a member in a sorted set", "key member", "sorted_set", "1.3.4", `@complexity
+ "zrank": {"zrank", "Determine the index of a member in a sorted set", "key member", "sorted_set", "1.3.4", `@complexity
O(log(N))
@@ -1568,7 +1568,7 @@ to low.
ZADD myzset 3 "three"
ZRANK myzset "three"
ZRANK myzset "four"`},
- "lrem": {"lrem", "Remove elements from a list", "key count value", "list", "0.07", `@complexity
+ "lrem": {"lrem", "Remove elements from a list", "key count value", "list", "0.07", `@complexity
O(N) where N is the length of the list.
@@ -1599,15 +1599,15 @@ not exist, the command will always return '0'.
RPUSH mylist "hello"
LREM mylist -2 "hello"
LRANGE mylist 0 -1`},
- "select": {"select", "Change the selected database for the current connection", "index", "connection", "0.07", `@description
+ "select": {"select", "Change the selected database for the current connection", "index", "connection", "0.07", `@description
Select the DB with having the specified zero-based numeric index.
New connections always use DB 0.
@return
@status-reply`},
- "discard": {"discard", "Discard all commands issued after MULTI", "-", "transactions", "1.3.3", `Flushes all previously queued commands in a
+ "discard": {"discard", "Discard all commands issued after MULTI", "-", "transactions", "1.3.3", `Flushes all previously queued commands in a
[transaction](/topics/transactions) and restores the connection state to
normal.
@@ -1616,7 +1616,7 @@ If 'WATCH' was used, 'DISCARD' unwatches all keys.
@return
@status-reply: always 'OK'.`},
- "zadd": {"zadd", "Add a member to a sorted set, or update its score if it already exists", "key score member", "sorted_set", "1.1", `@complexity
+ "zadd": {"zadd", "Add a member to a sorted set, or update its score if it already exists", "key score member", "sorted_set", "1.1", `@complexity
O(log(N)) where N is the number of elements in the sorted set.
@@ -1648,7 +1648,7 @@ sets](/topics/data-types#sorted-sets).
ZADD myzset 2 "two"
ZADD myzset 3 "two"
ZRANGE myzset 0 -1 WITHSCORES`},
- "info": {"info", "Get information and statistics about the server", "-", "server", "0.07", `The 'INFO' command returns information and statistics about the server
+ "info": {"info", "Get information and statistics about the server", "-", "server", "0.07", `The 'INFO' command returns information and statistics about the server
in format that is simple to parse by computers and easy to red by humans.
@return
@@ -1694,7 +1694,7 @@ All the fields are in the form of 'field:value' terminated by '\r\n'.
type of allocations performed by Redis at run time.
[1]: http://code.google.com/p/google-perftools/`},
- "exec": {"exec", "Execute all commands issued after MULTI", "-", "transactions", "1.1.95", `Executes all previously queued commands in a
+ "exec": {"exec", "Execute all commands issued after MULTI", "-", "transactions", "1.1.95", `Executes all previously queued commands in a
[transaction](/topics/transactions) and restores the connection state to
normal.
@@ -1709,7 +1709,7 @@ in the atomic transaction.
When using 'WATCH', 'EXEC' can return a @nil-reply if the execution was
aborted.`},
- "decrby": {"decrby", "Decrement the integer value of a key by the given number", "key decrement", "string", "0.07", `@complexity
+ "decrby": {"decrby", "Decrement the integer value of a key by the given number", "key decrement", "string", "0.07", `@complexity
O(1)
@@ -1730,7 +1730,7 @@ See 'INCR' for extra information on increment/decrement operations.
@cli
SET mykey "10"
DECRBY mykey 5`},
- "ping": {"ping", "Ping the server", "-", "connection", "0.07", `@description
+ "ping": {"ping", "Ping the server", "-", "connection", "0.07", `@description
Returns 'PONG'. This command is often used to test if a connection is still
alive, or to measure latency.
@@ -1743,7 +1743,7 @@ alive, or to measure latency.
@cli
PING`},
- "llen": {"llen", "Get the length of a list", "key", "list", "0.07", `@complexity
+ "llen": {"llen", "Get the length of a list", "key", "list", "0.07", `@complexity
O(1)
@@ -1762,7 +1762,7 @@ An error is returned when the value stored at 'key' is not a list.
LPUSH mylist "World"
LPUSH mylist "Hello"
LLEN mylist`},
- "hmget": {"hmget", "Get the values of all the given hash fields", "key field [field ...]", "hash", "1.3.10", `@complexity
+ "hmget": {"hmget", "Get the values of all the given hash fields", "key field [field ...]", "hash", "1.3.10", `@complexity
O(N) where N is the number of fields being requested.
@@ -1782,7 +1782,7 @@ order as they are requested.
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HMGET myhash field1 field2 nofield`},
- "unsubscribe": {"unsubscribe", "Stop listening for messages posted to the given channels", "[channel [channel ...]]", "pubsub", "1.3.8", `@complexity
+ "unsubscribe": {"unsubscribe", "Stop listening for messages posted to the given channels", "[channel [channel ...]]", "pubsub", "1.3.8", `@complexity
O(N) where N is the number of clients already subscribed to a channel.
@@ -1792,7 +1792,7 @@ none is given.
When no channels are specified, the client is unsubscribed from all
the previously subscribed channels. In this case, a message for every
unsubscribed channel will be sent to the client.`},
- "decr": {"decr", "Decrement the integer value of a key by one", "key", "string", "0.07", `@complexity
+ "decr": {"decr", "Decrement the integer value of a key by one", "key", "string", "0.07", `@complexity
O(1)
@@ -1813,7 +1813,7 @@ See 'INCR' for extra information on increment/decrement operations.
@cli
SET mykey "10"
DECR mykey`},
- "rpop": {"rpop", "Remove and get the last element in a list", "key", "list", "0.07", `@complexity
+ "rpop": {"rpop", "Remove and get the last element in a list", "key", "list", "0.07", `@complexity
O(1)
@@ -1832,7 +1832,7 @@ Removes and returns the last element of the list stored at 'key'.
RPUSH mylist "three"
RPOP mylist
LRANGE mylist 0 -1`},
- "zrevrange": {"zrevrange", "Return a range of members in a sorted set, by index, with scores ordered from high to low", "key start stop [WITHSCORES]", "sorted_set", "1.1", `@complexity
+ "zrevrange": {"zrevrange", "Return a range of members in a sorted set, by index, with scores ordered from high to low", "key start stop [WITHSCORES]", "sorted_set", "1.1", `@complexity
O(log(N)+M) with N being the number of elements in the
sorted set and M the number of elements returned.
@@ -1857,7 +1857,7 @@ their scores).
ZREVRANGE myzset 0 -1
ZREVRANGE myzset 2 3
ZREVRANGE myzset -2 -1`},
- "zrangebyscore": {"zrangebyscore", "Return a range of members in a sorted set, by score", "key min max [WITHSCORES] [LIMIT offset count]", "sorted_set", "1.050", `@complexity
+ "zrangebyscore": {"zrangebyscore", "Return a range of members in a sorted set, by score", "key min max [WITHSCORES] [LIMIT offset count]", "sorted_set", "1.050", `@complexity
O(log(N)+M) with N being the number of elements in the sorted set and M the
number of elements being returned. If M is constant (e.g. always asking for the
@@ -1914,7 +1914,7 @@ their scores).
ZRANGEBYSCORE myzset 1 2
ZRANGEBYSCORE myzset (1 2
ZRANGEBYSCORE myzset (1 (2`},
- "lpushx": {"lpushx", "Prepend a value to a list, only if the list exists", "key value", "list", "2.1.1", `@complexity
+ "lpushx": {"lpushx", "Prepend a value to a list, only if the list exists", "key value", "list", "2.1.1", `@complexity
O(1)
@@ -1935,7 +1935,7 @@ be performed when 'key' does not yet exist.
LPUSHX myotherlist "Hello"
LRANGE mylist 0 -1
LRANGE myotherlist 0 -1`},
- "blpop": {"blpop", "Remove and get the first element in a list, or block until one is available", "key [key ...] timeout", "list", "1.3.1", `@complexity
+ "blpop": {"blpop", "Remove and get the first element in a list, or block until one is available", "key [key ...] timeout", "list", "1.3.1", `@complexity
O(1)
@@ -2004,7 +2004,7 @@ infinite speed inside a 'MULTI'/'EXEC' block.
* A 'nil' multi-bulk when no element could be popped and the timeout expired.
* A two-element multi-bulk with the first element being the name of the key where an element
was popped and the second element being the value of the popped element.`},
- "hget": {"hget", "Get the value of a hash field", "key field", "hash", "1.3.10", `@complexity
+ "hget": {"hget", "Get the value of a hash field", "key field", "hash", "1.3.10", `@complexity
O(1)
@@ -2022,7 +2022,7 @@ present in the hash or 'key' does not exist.
HSET myhash field1 "foo"
HGET myhash field1
HGET myhash field2`},
- "setex": {"setex", "Set the value and expiration of a key", "key seconds value", "string", "1.3.10", `@complexity
+ "setex": {"setex", "Set the value and expiration of a key", "key seconds value", "string", "1.3.10", `@complexity
O(1)
@@ -2051,7 +2051,7 @@ An error is returned when 'seconds' is invalid.
SETEX mykey 10 "Hello"
TTL mykey
GET mykey`},
- "type": {"type", "Determine the type stored at key", "key", "generic", "0.07", `@complexity
+ "type": {"type", "Determine the type stored at key", "key", "generic", "0.07", `@complexity
O(1)
@@ -2073,7 +2073,7 @@ and 'hash'.
TYPE key1
TYPE key2
TYPE key3`},
- "sinterstore": {"sinterstore", "Intersect multiple sets and store the resulting set in a key", "destination key [key ...]", "set", "0.07", `@complexity
+ "sinterstore": {"sinterstore", "Intersect multiple sets and store the resulting set in a key", "destination key [key ...]", "set", "0.07", `@complexity
O(N*M) worst case where N is the cardinality of the smallest set and M is the
number of sets.
@@ -2086,7 +2086,7 @@ If 'destination' already exists, it is overwritten.
@return
@integer-reply: the number of elements in the resulting set.`},
- "msetnx": {"msetnx", "Set multiple keys to multiple values, only if none of the keys exist", "key value [key value ...]", "string", "1.001", `@complexity
+ "msetnx": {"msetnx", "Set multiple keys to multiple values, only if none of the keys exist", "key value [key value ...]", "string", "1.001", `@complexity
O(N) where N is the number of keys to set
@@ -2114,7 +2114,7 @@ clients to see that some of the keys were updated while others are unchanged.
MSETNX key1 "Hello" key2 "there"
MSETNX key2 "there" key3 "world"
MGET key1 key2 key3`},
- "ttl": {"ttl", "Get the time to live for a key", "key", "generic", "0.100", `@complexity
+ "ttl": {"ttl", "Get the time to live for a key", "key", "generic", "0.100", `@complexity
O(1)
@@ -2133,14 +2133,14 @@ given key will continue to be part of the dataset.
SET mykey "Hello"
EXPIRE mykey 10
TTL mykey`},
- "save": {"save", "Synchronously save the dataset to disk", "-", "server", "0.07", `@complexity
+ "save": {"save", "Synchronously save the dataset to disk", "-", "server", "0.07", `@complexity
@description
@examples
@return`},
- "sdiffstore": {"sdiffstore", "Subtract multiple sets and store the resulting set in a key", "destination key [key ...]", "set", "0.100", `@complexity
+ "sdiffstore": {"sdiffstore", "Subtract multiple sets and store the resulting set in a key", "destination key [key ...]", "set", "0.100", `@complexity
O(N) where N is the total number of elements in all given sets.
@@ -2152,7 +2152,7 @@ If 'destination' already exists, it is overwritten.
@return
@integer-reply: the number of elements in the resulting set.`},
- "hincrby": {"hincrby", "Increment the integer value of a hash field by the given number", "key field increment", "hash", "1.3.10", `@complexity
+ "hincrby": {"hincrby", "Increment the integer value of a hash field by the given number", "key field increment", "hash", "1.3.10", `@complexity
O(1)
@@ -2179,7 +2179,7 @@ operations can be performed:
HINCRBY myhash field 1
HINCRBY myhash field -1
HINCRBY myhash field -10`},
- "smembers": {"smembers", "Get all the members in a set", "key", "set", "0.07", `@complexity
+ "smembers": {"smembers", "Get all the members in a set", "key", "set", "0.07", `@complexity
O(N) where N is the set cardinality.
@@ -2197,7 +2197,7 @@ This has the same effect as running 'SINTER' with one argument 'key'.
SADD myset "Hello"
SADD myset "World"
SMEMBERS myset`},
- "slaveof": {"slaveof", "Make the server a slave of another instance, or promote it as master", "host port", "server", "0.100", `The 'SLAVEOF' command can change the replication settings of a slave on the fly.
+ "slaveof": {"slaveof", "Make the server a slave of another instance, or promote it as master", "host port", "server", "0.100", `The 'SLAVEOF' command can change the replication settings of a slave on the fly.
If a Redis server is already acting as slave, the command 'SLAVEOF' NO ONE
will turn off the replication turning the Redis server into a MASTER.
In the proper form 'SLAVEOF' hostname port will make the server a slave of the
@@ -2216,15 +2216,15 @@ fixed it can be configured in order to work as slave.
@return
@status-reply`},
- "lastsave": {"lastsave", "Get the UNIX time stamp of the last successful save to disk", "-", "server", "0.07", `Return the UNIX TIME of the last DB save executed with success.
+ "lastsave": {"lastsave", "Get the UNIX time stamp of the last successful save to disk", "-", "server", "0.07", `Return the UNIX TIME of the last DB save executed with success.
A client may check if a 'BGSAVE' command succeeded reading the 'LASTSAVE'
value, then issuing a 'BGSAVE' command and checking at regular intervals
every N seconds if 'LASTSAVE' changed.
@return
@integer-reply: an UNIX time stamp.`},
- "punsubscribe": {"punsubscribe", "Stop listening for messages posted to channels matching the given patterns", "[pattern [pattern ...]]", "pubsub", "1.3.8", `@complexity
+ "punsubscribe": {"punsubscribe", "Stop listening for messages posted to channels matching the given patterns", "[pattern [pattern ...]]", "pubsub", "1.3.8", `@complexity
O(N+M) where N is the number of patterns the client is already
subscribed and M is the number of total patterns subscribed in the
@@ -2236,7 +2236,7 @@ none is given.
When no patters are specified, the client is unsubscribed from all
the previously subscribed patterns. In this case, a message for every
unsubscribed pattern will be sent to the client.`},
- "echo": {"echo", "Echo the given string", "message", "connection", "0.07", `@description
+ "echo": {"echo", "Echo the given string", "message", "connection", "0.07", `@description
Returns 'message'.
@@ -2248,14 +2248,14 @@ Returns 'message'.
@cli
ECHO "Hello World!"`},
- "debug object": {"debug object", "Get debugging information about a key", "key", "server", "0.101", `@complexity
+ "debug object": {"debug object", "Get debugging information about a key", "key", "server", "0.101", `@complexity
@description
@examples
@return`},
- "getrange": {"getrange", "Get a substring of the string stored at a key", "key start end", "string", "1.3.4", `@complexity
+ "getrange": {"getrange", "Get a substring of the string stored at a key", "key start end", "string", "1.3.4", `@complexity
O(N) where N is the length of the returned string. The complexity is ultimately
determined by the returned length, but because creating a substring from an
@@ -2283,7 +2283,7 @@ the actual length of the string.
GETRANGE mykey -3 -1
GETRANGE mykey 0 -1
GETRANGE mykey 10 100`},
- "hset": {"hset", "Set the string value of a hash field", "key field value", "hash", "1.3.10", `@complexity
+ "hset": {"hset", "Set the string value of a hash field", "key field value", "hash", "1.3.10", `@complexity
O(1)
@@ -2304,7 +2304,7 @@ is overwritten.
@cli
HSET myhash field1 "Hello"
HGET myhash field1`},
- "rpush": {"rpush", "Append a value to a list", "key value", "list", "0.07", `@complexity
+ "rpush": {"rpush", "Append a value to a list", "key value", "list", "0.07", `@complexity
O(1)
@@ -2323,15 +2323,15 @@ When 'key' holds a value that is not a list, an error is returned.
RPUSH mylist "hello"
RPUSH mylist "world"
LRANGE mylist 0 -1`},
- "quit": {"quit", "Close the connection", "-", "connection", "0.07", `@description
+ "quit": {"quit", "Close the connection", "-", "connection", "0.07", `@description
Ask the server to close the connection. The connection is closed as soon as all
pending replies have been written to the client.
@return
@status-reply: always OK.`},
- "lrange": {"lrange", "Get a range of elements from a list", "key start stop", "list", "0.07", `@complexity
+ "lrange": {"lrange", "Get a range of elements from a list", "key start stop", "list", "0.07", `@complexity
O(S+N) where S is the 'start' offset and N is the number of elements in the
specified range.
@@ -2373,14 +2373,14 @@ element of the list.
LRANGE mylist -3 2
LRANGE mylist -100 100
LRANGE mylist 5 10`},
- "sync": {"sync", "Internal command used for replication", "-", "server", "0.07", `@complexity
+ "sync": {"sync", "Internal command used for replication", "-", "server", "0.07", `@complexity
@description
@examples
@return`},
- "setnx": {"setnx", "Set the value of a key, only if the key does not exist", "key value", "string", "0.07", `@complexity
+ "setnx": {"setnx", "Set the value of a key, only if the key does not exist", "key value", "string", "0.07", `@complexity
O(1)
@@ -2465,7 +2465,7 @@ holding a lock should always check the timeout didn't expire before unlocking
the key with 'DEL' because client failures can be complex, not just crashing
but also blocking a lot of time against some operations and trying to issue
'DEL' after a lot of time (when the LOCK is already held by another client).`},
- "spop": {"spop", "Remove and return a random member from a set", "key", "set", "0.101", `@complexity
+ "spop": {"spop", "Remove and return a random member from a set", "key", "set", "0.101", `@complexity
O(1)
@@ -2487,7 +2487,7 @@ element from a set but does not remove it.
SADD myset "three"
SPOP myset
SMEMBERS myset`},
- "monitor": {"monitor", "Listen for all requests received by the server in real time", "-", "server", "0.07", `'MONITOR' is a debugging command that outputs the whole sequence of commands
+ "monitor": {"monitor", "Listen for all requests received by the server in real time", "-", "server", "0.07", `'MONITOR' is a debugging command that outputs the whole sequence of commands
received by the Redis server. is very handy in order to understand
what is happening into the database. This command is used directly
via telnet.
@@ -2523,7 +2523,7 @@ In order to end a monitoring session just issue a 'QUIT' command by hand.
**Non standard return value**, just dumps the received commands in an infinite
flow.`},
- "zinterstore": {"zinterstore", "Intersect multiple sorted sets and store the resulting sorted set in a new key", "destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]", "sorted_set", "1.3.10", `@complexity
+ "zinterstore": {"zinterstore", "Intersect multiple sorted sets and store the resulting sorted set in a new key", "destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]", "sorted_set", "1.3.10", `@complexity
O(N\*K)+O(M\*log(M)) worst case with N being the smallest input sorted set, K
being the number of input sorted sets and M being the number of elements in the
@@ -2558,7 +2558,7 @@ If 'destination' already exists, it is overwritten.
ZADD zset2 3 "three"
ZINTERSTORE out 2 zset1 zset2 WEIGHTS 2 3
ZRANGE out 0 -1 WITHSCORES`},
- "get": {"get", "Get the value of a key", "key", "string", "0.07", `@complexity
+ "get": {"get", "Get the value of a key", "key", "string", "0.07", `@complexity
O(1)
@@ -2577,7 +2577,7 @@ only handles string values.
GET nonexisting
SET mykey "Hello"
GET mykey`},
- "zcard": {"zcard", "Get the number of members in a sorted set", "key", "sorted_set", "1.1", `@complexity
+ "zcard": {"zcard", "Get the number of members in a sorted set", "key", "sorted_set", "1.1", `@complexity
O(1)
@@ -2596,7 +2596,7 @@ if 'key' does not exist.
ZADD myzset 1 "one"
ZADD myzset 2 "two"
ZCARD myzset`},
- "setrange": {"setrange", "Overwrite part of a string at key starting at the specified offset", "key offset value", "string", "2.1.8", `@complexity
+ "setrange": {"setrange", "Overwrite part of a string at key starting at the specified offset", "key offset value", "string", "2.1.8", `@complexity
O(1), not counting the time taken to copy the new string in place. Usually,
this string is very small so the amortized complexity is O(1). Otheriwse,
@@ -2647,12 +2647,12 @@ Example of zero padding:
@cli
SETRANGE key2 6 "Redis"
GET key2`},
- "flushall": {"flushall", "Remove all keys from all databases", "-", "server", "0.07", `Delete all the keys of all the existing databases, not just the currently selected one. This command never fails.
+ "flushall": {"flushall", "Remove all keys from all databases", "-", "server", "0.07", `Delete all the keys of all the existing databases, not just the currently selected one. This command never fails.
@return
@status-reply`},
- "sunion": {"sunion", "Add multiple sets", "key [key ...]", "set", "0.091", `@complexity
+ "sunion": {"sunion", "Add multiple sets", "key [key ...]", "set", "0.091", `@complexity
O(N) where N is the total number of elements in all given sets.
@@ -2682,7 +2682,7 @@ Keys that do not exist are considered to be empty sets.
SADD key2 "d"
SADD key2 "e"
SUNION key1 key2`},
- "zscore": {"zscore", "Get the score associated with the given member in a sorted set", "key member", "sorted_set", "1.1", `@complexity
+ "zscore": {"zscore", "Get the score associated with the given member in a sorted set", "key member", "sorted_set", "1.1", `@complexity
O(1)
@@ -2702,14 +2702,14 @@ represented as string.
@cli
ZADD myzset 1 "one"
ZSCORE myzset "one"`},
- "multi": {"multi", "Mark the start of a transaction block", "-", "transactions", "1.1.95", `Marks the start of a [transaction](/topics/transactions)
+ "multi": {"multi", "Mark the start of a transaction block", "-", "transactions", "1.1.95", `Marks the start of a [transaction](/topics/transactions)
block. Subsequent commands will be queued for atomic execution using
'EXEC'.
@return
@status-reply: always 'OK'.`},
- "hmset": {"hmset", "Set multiple hash fields to multiple values", "key field value [field value ...]", "hash", "1.3.8", `@complexity
+ "hmset": {"hmset", "Set multiple hash fields to multiple values", "key field value [field value ...]", "hash", "1.3.8", `@complexity
O(N) where N is the number of fields being set.
@@ -2727,7 +2727,7 @@ If 'key' does not exist, a new key holding a hash is created.
HMSET myhash field1 "Hello" field2 "World"
HGET myhash field1
HGET myhash field2`},
- "incrby": {"incrby", "Increment the integer value of a key by the given number", "key increment", "string", "0.07", `@complexity
+ "incrby": {"incrby", "Increment the integer value of a key by the given number", "key increment", "string", "0.07", `@complexity
O(1)
@@ -2748,7 +2748,7 @@ See 'INCR' for extra information on increment/decrement operations.
@cli
SET mykey "10"
INCRBY mykey 5`},
- "hvals": {"hvals", "Get all the values in a hash", "key", "hash", "1.3.10", `@complexity
+ "hvals": {"hvals", "Get all the values in a hash", "key", "hash", "1.3.10", `@complexity
O(N) where N is the size of the hash.
@@ -2765,14 +2765,14 @@ not exist.
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HVALS myhash`},
- "config set": {"config set", "Set a configuration parameter to the given value", "parameter value", "server", "2.0", `@complexity
+ "config set": {"config set", "Set a configuration parameter to the given value", "parameter value", "server", "2.0", `@complexity
@description
@examples
@return`},
- "shutdown": {"shutdown", "Synchronously save the dataset to disk and then shut down the server", "-", "server", "0.07", `Stop all the clients, save the DB, then quit the server. This commands
+ "shutdown": {"shutdown", "Synchronously save the dataset to disk and then shut down the server", "-", "server", "0.07", `Stop all the clients, save the DB, then quit the server. This commands
makes sure that the DB is switched off without the lost of any data.
This is not guaranteed if the client uses simply 'SAVE' and then
'QUIT' because other clients may alter the DB data between the two
View
42 redoc.go
@@ -25,9 +25,9 @@ var (
summary = flag.Bool("s", true, "display summary")
// general
- colors = flag.Bool("c", true, "use colors")
- listCommands = flag.Bool("lc", false, "list all available commands")
- listGroups = flag.Bool("lg", false, "list all available groups")
+ colors = flag.Bool("c", true, "use colors")
+ listCommands = flag.Bool("lc", false, "list all available commands")
+ listGroups = flag.Bool("lg", false, "list all available groups")
)
func usage() {
@@ -40,24 +40,24 @@ func (c *Command) printCommand() {
var formats map[string]string
if *colors {
- formats = map[string]string {
- "name": " \x1b[1m%s\x1b[0m \x1b[90m%s\x1b[0m\n",
- "summary": " \x1b[38;5;31msummary:\x1b[0m %s\n",
- "since": " \x1b[38;5;31msince:\x1b[0m %s\n",
- "group": " \x1b[38;5;31mgroup:\x1b[0m %s\n",
+ formats = map[string]string{
+ "name": " \x1b[1m%s\x1b[0m \x1b[90m%s\x1b[0m\n",
+ "summary": " \x1b[38;5;31msummary:\x1b[0m %s\n",
+ "since": " \x1b[38;5;31msince:\x1b[0m %s\n",
+ "group": " \x1b[38;5;31mgroup:\x1b[0m %s\n",
"description": " \x1b[38;5;31mdescription:\x1b[0m\n\n\x1b[90m%s\x1b[0m\n",
}
} else {
- formats = map[string]string {
- "name": " %s %s\n",
- "summary": " summary: %s\n",
- "since": " since: %s\n",
- "group": " group: %s\n",
+ formats = map[string]string{
+ "name": " %s %s\n",
+ "summary": " summary: %s\n",
+ "since": " since: %s\n",
+ "group": " group: %s\n",
"description": " description:\n\n%s\n",
}
}
- fmt.Fprintf(os.Stdout, formats["name"],strings.ToUpper(c.Name), c.Arguments)
+ fmt.Fprintf(os.Stdout, formats["name"], strings.ToUpper(c.Name), c.Arguments)
if *summary {
fmt.Fprintf(os.Stdout, formats["summary"], c.Summary)
@@ -82,14 +82,14 @@ func printName(name string) bool {
if c, ok := Commands[name]; ok {
c.printCommand()
return ok
- }
+ }
return false
}
func printCommands() {
var commands []string
- for k, _ := range Commands {
+ for k := range Commands {
commands = append(commands, k)
}
@@ -107,15 +107,15 @@ func printGroup(name string) bool {
for k, v := range g {
if k == name {
- printGrouped(map[string][]string{k: v,})
+ printGrouped(map[string][]string{k: v})
}
}
return false
}
func printGroups() {
- found := map[string] bool{}
+ found := map[string]bool{}
var groups []string
for _, v := range Commands {
@@ -161,7 +161,7 @@ func main() {
flag.Usage = usage
flag.Parse()
args := flag.Args()
-
+
if *listGroups {
printGroups()
os.Exit(0)
@@ -178,12 +178,12 @@ func main() {
if !printGroup(typ) {
os.Exit(1)
}
- }
+ }
os.Exit(0)
}
g := orderByGroup()
printGrouped(g)
-
+
os.Exit(0)
}

0 comments on commit 3be09ec

Please sign in to comment.
Something went wrong with that request. Please try again.