MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / existsCommand

Function existsCommand

src/db.cpp:917–925  ·  view source on GitHub ↗

EXISTS key1 key2 ... key_N. * Return value is the number of keys existing. */

Source from the content-addressed store, hash-verified

915/* EXISTS key1 key2 ... key_N.
916 * Return value is the number of keys existing. */
917void existsCommand(client *c) {
918 long long count = 0;
919 int j;
920
921 for (j = 1; j < c->argc; j++) {
922 if (lookupKeyReadWithFlags(c->db,c->argv[j],LOOKUP_NOTOUCH)) count++;
923 }
924 addReplyLongLong(c,count);
925}
926
927void mexistsCommand(client *c) {
928 addReplyArrayLen(c, c->argc - 1);

Callers

nothing calls this directly

Calls 2

lookupKeyReadWithFlagsFunction · 0.85
addReplyLongLongFunction · 0.85

Tested by

no test coverage detected