Fix command GEOHASH and GEOPOS argument doc, mark member as optional (#11417)

These commands take a list of members, which can be empty (i.e. running
the command with just a key name).
this always results in an empty array reply, so it doesn't make much sense,
but changing it is a breaking change.

This PR fixes the documentation, making the member field as optional, just makes
sure the command format documentation is consistent with the command behavior.

The command format will be:

127.0.0.1:6381> GEOPOS key [member [member ...]]
127.0.0.1:6381> GEOHASH key [member [member ...]]
This commit is contained in:
Wen Hui
2022-10-25 14:26:08 +03:00
committed by GitHub
parent f8970fdbfa
commit 7c3916ae6e
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -1872,7 +1872,7 @@ struct redisCommandArg GEODIST_Args[] = {
/* GEOHASH argument table */
struct redisCommandArg GEOHASH_Args[] = {
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
{"member",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE},
{"member",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE},
{0}
};
@@ -1887,7 +1887,7 @@ struct redisCommandArg GEOHASH_Args[] = {
/* GEOPOS argument table */
struct redisCommandArg GEOPOS_Args[] = {
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
{"member",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE},
{"member",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE},
{0}
};
+2 -1
View File
@@ -41,7 +41,8 @@
{
"name": "member",
"type": "string",
"multiple": true
"multiple": true,
"optional": true
}
]
}
+2 -1
View File
@@ -41,7 +41,8 @@
{
"name": "member",
"type": "string",
"multiple": true
"multiple": true,
"optional": true
}
]
}