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

Function RM_DeleteKey

src/module.cpp:2419–2426  ·  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

2417 * On success REDISMODULE_OK is returned. If the key is not open for
2418 * writing REDISMODULE_ERR is returned. */
2419int RM_DeleteKey(RedisModuleKey *key) {
2420 if (!(key->mode & REDISMODULE_WRITE)) return REDISMODULE_ERR;
2421 if (key->value) {
2422 dbDelete(key->db,key->key);
2423 key->value = NULL;
2424 }
2425 return REDISMODULE_OK;
2426}
2427
2428/* If the key is open for writing, unlink it (that is delete it in a
2429 * 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