Add the KEYDB.MEXISTS command, see issue #203

Former-commit-id: 5619f515285b08d9c443425de1f3092ae3058d40
This commit is contained in:
John Sully 2020-07-12 21:42:11 +00:00
parent c5f6cb1ba5
commit cfcb5ac5c7
4 changed files with 18 additions and 1 deletions

View File

@ -683,6 +683,13 @@ void existsCommand(client *c) {
addReplyLongLong(c,count);
}
void mexistsCommand(client *c) {
addReplyArrayLen(c, c->argc - 1);
for (int j = 1; j < c->argc; ++j) {
addReplyBool(c, lookupKeyRead(c->db, c->argv[j]));
}
}
void selectCommand(client *c) {
long id;

View File

@ -1325,7 +1325,12 @@ struct commandHelp {
"Rename a hash key, copying the value.",
4,
"6.5.3"
}
},
{ "KEYDB.MEXISTS",
"key [key ...]",
"Determine if a key exists",
0,
"6.5.12" },
};
#endif

View File

@ -247,6 +247,10 @@ struct redisCommand redisCommandTable[] = {
"read-only fast @keyspace",
0,NULL,1,-1,1,0,0,0},
{"keydb.mexists",mexistsCommand,-2,
"read-only fast @keyspace",
0,NULL,1,-1,1,0,0,0},
{"setbit",setbitCommand,4,
"write use-memory @bitmap",
0,NULL,1,1,1,0,0,0},

View File

@ -2822,6 +2822,7 @@ void getCommand(client *c);
void delCommand(client *c);
void unlinkCommand(client *c);
void existsCommand(client *c);
void mexistsCommand(client *c);
void setbitCommand(client *c);
void getbitCommand(client *c);
void bitfieldCommand(client *c);