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

Function RM_StringSet

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

If the key is open for writing, set the specified string 'str' as the * value of the key, deleting the old value if any. * On success REDISMODULE_OK is returned. If the key is not open for * writing or there is an active iterator, REDISMODULE_ERR is returned. */

Source from the content-addressed store, hash-verified

2450 * On success REDISMODULE_OK is returned. If the key is not open for
2451 * writing or there is an active iterator, REDISMODULE_ERR is returned. */
2452int RM_StringSet(RedisModuleKey *key, RedisModuleString *str) {
2453 if (!(key->mode & REDISMODULE_WRITE) || key->iter) return REDISMODULE_ERR;
2454 RM_DeleteKey(key);
2455 genericSetKey(key->ctx->client,key->db,key->key,str,0,0);
2456 key->value = str;
2457 return REDISMODULE_OK;
2458}
2459
2460/* Prepare the key associated string value for DMA access, and returns
2461 * a pointer and size (by reference), that the user can use to read or

Callers

nothing calls this directly

Calls 2

RM_DeleteKeyFunction · 0.85
genericSetKeyFunction · 0.85

Tested by

no test coverage detected