Unverified Commit 0c3b8b7e authored by Itamar Haber's avatar Itamar Haber Committed by GitHub
Browse files

Overhauls command summaries and man pages. (#11942)

This is an attempt to normalize/formalize command summaries.

Main actions performed:

* Starts with the continuation of the phrase "The XXXX command, when called, ..." for user commands.
* Starts with "An internal command...", "A container command...", etc... when applicable.
* Always uses periods.
* Refrains from referring to other commands. If this is needed, backquotes should be used for command names.
* Tries to be very clear about the data type when applicable.
* Tries to mention additional effects, e.g. "The key is created if it doesn't exist" and "The set is deleted if the last member is removed."
* Prefers being terse over verbose.
* Tries to be consistent.
parent cb171786
{
"ZREMRANGEBYSCORE": {
"summary": "Remove all members in a sorted set within the given scores",
"summary": "Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed.",
"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.",
"group": "sorted_set",
"since": "1.2.0",
......
{
"ZREVRANGE": {
"summary": "Return a range of members in a sorted set, by index, with scores ordered from high to low",
"summary": "Returns members in a sorted set within a range of indexes in reverse order.",
"complexity": "O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.",
"group": "sorted_set",
"since": "1.2.0",
......
{
"ZREVRANGEBYLEX": {
"summary": "Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.",
"summary": "Returns members in a sorted set within a lexicographical range in reverse order.",
"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 first 10 elements with LIMIT), you can consider it O(log(N)).",
"group": "sorted_set",
"since": "2.8.9",
......
{
"ZREVRANGEBYSCORE": {
"summary": "Return a range of members in a sorted set, by score, with scores ordered from high to low",
"summary": "Returns members in a sorted set within a range of scores in reverse order.",
"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 first 10 elements with LIMIT), you can consider it O(log(N)).",
"group": "sorted_set",
"since": "2.2.0",
......
{
"ZREVRANK": {
"summary": "Determine the index of a member in a sorted set, with scores ordered from high to low",
"summary": "Returns the index of a member in a sorted set ordered by descending scores.",
"complexity": "O(log(N))",
"group": "sorted_set",
"since": "2.0.0",
......
{
"ZSCAN": {
"summary": "Incrementally iterate sorted sets elements and associated scores",
"summary": "Iterates over members and scores of a sorted set.",
"complexity": "O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.",
"group": "sorted_set",
"since": "2.8.0",
......
{
"ZSCORE": {
"summary": "Get the score associated with the given member in a sorted set",
"summary": "Returns the score of a member in a sorted set.",
"complexity": "O(1)",
"group": "sorted_set",
"since": "1.2.0",
......
{
"ZUNION": {
"summary": "Add multiple sorted sets",
"summary": "Returns the union of multiple sorted sets.",
"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.",
"group": "sorted_set",
"since": "6.2.0",
......
{
"ZUNIONSTORE": {
"summary": "Add multiple sorted sets and store the resulting sorted set in a new key",
"summary": "Stores the union of multiple sorted sets in a key.",
"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.",
"group": "sorted_set",
"since": "2.0.0",
......
......@@ -23,7 +23,7 @@ int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
RedisModuleCommandInfo info = {
.version = REDISMODULE_COMMAND_INFO_VERSION,
.arity = -5,
.summary = "Appends a new entry to a stream",
.summary = "Appends a new message to a stream. Creates the key if it doesn't exist.",
.since = "5.0.0",
.complexity = "O(1) when adding a new entry, O(N) when trimming where N being the number of entries evicted.",
.tips = "nondeterministic_output",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment