Add the KEYDB.MEXISTS command, see issue #203
Former-commit-id: 5619f515285b08d9c443425de1f3092ae3058d40
This commit is contained in:
parent
c5f6cb1ba5
commit
cfcb5ac5c7
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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},
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user