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. */
| 2417 | * On success REDISMODULE_OK is returned. If the key is not open for |
| 2418 | * writing REDISMODULE_ERR is returned. */ |
| 2419 | int 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 |
no test coverage detected