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

Function RM_DeleteKey

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

If the key is open for writing, remove it, and setup the key to * accept new writes as an empty key (that will be created on demand). * On success REDISMODULE_OK is returned. If the key is not open for * writing REDISMODULE_ERR is returned. */

Source from the content-addressed store, hash-verified

2333 * On success REDISMODULE_OK is returned. If the key is not open for
2334 * writing REDISMODULE_ERR is returned. */
2335int RM_DeleteKey(RedisModuleKey *key) {
2336 if (!(key->mode & REDISMODULE_WRITE)) return REDISMODULE_ERR;
2337 if (key->value) {
2338 dbDelete(key->db,key->key);
2339 key->value = NULL;
2340 }
2341 return REDISMODULE_OK;
2342}
2343
2344/* If the key is open for writing, unlink it (that is delete it in a
2345 * non-blocking way, not reclaiming memory immediately) and setup the key to

Callers 2

RM_StringSetFunction · 0.85
RM_ModuleTypeSetValueFunction · 0.85

Calls 1

dbDeleteFunction · 0.85

Tested by

no test coverage detected