diff options
author | Wen Hui <wen.hui.ware@gmail.com> | 2022-10-25 07:26:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 14:26:08 +0300 |
commit | 7c3916ae6e5bc31a6991986dd52a5ae9b4147fae (patch) | |
tree | 734ced8697a1b7107869836443d157a41965c6b7 | |
parent | f8970fdbfa138f8576340ff0af73c3d2603c7e8e (diff) | |
download | redis-7c3916ae6e5bc31a6991986dd52a5ae9b4147fae.tar.gz |
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 ...]]
-rw-r--r-- | src/commands.c | 4 | ||||
-rw-r--r-- | src/commands/geohash.json | 3 | ||||
-rw-r--r-- | src/commands/geopos.json | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/commands.c b/src/commands.c index b9b4b915d..c432d0a12 100644 --- a/src/commands.c +++ b/src/commands.c @@ -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} }; diff --git a/src/commands/geohash.json b/src/commands/geohash.json index 4cb383ca3..040c631d1 100644 --- a/src/commands/geohash.json +++ b/src/commands/geohash.json @@ -41,7 +41,8 @@ { "name": "member", "type": "string", - "multiple": true + "multiple": true, + "optional": true } ] } diff --git a/src/commands/geopos.json b/src/commands/geopos.json index a41d162b2..242f6a887 100644 --- a/src/commands/geopos.json +++ b/src/commands/geopos.json @@ -41,7 +41,8 @@ { "name": "member", "type": "string", - "multiple": true + "multiple": true, + "optional": true } ] } |