MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_RandomKey

Function RM_RandomKey

app/redis-6.2.6/src/module.c:2436–2440  ·  view source on GitHub ↗

Returns a name of a random key, or NULL if current db is empty. */

Source from the content-addressed store, hash-verified

2434
2435/* Returns a name of a random key, or NULL if current db is empty. */
2436RedisModuleString *RM_RandomKey(RedisModuleCtx *ctx) {
2437 robj *key = dbRandomKey(ctx->client->db);
2438 autoMemoryAdd(ctx,REDISMODULE_AM_STRING,key);
2439 return key;
2440}
2441
2442/* --------------------------------------------------------------------------
2443 * ## Key API for String type

Callers

nothing calls this directly

Calls 2

dbRandomKeyFunction · 0.85
autoMemoryAddFunction · 0.85

Tested by

no test coverage detected