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. */
| 2538 | * On success REDISMODULE_OK is returned. If the key is not open for |
| 2539 | * writing or there is an active iterator, REDISMODULE_ERR is returned. */ |
| 2540 | int RM_StringSet(RedisModuleKey *key, RedisModuleString *str) { |
| 2541 | if (!(key->mode & REDISMODULE_WRITE) || key->iter) return REDISMODULE_ERR; |
| 2542 | RM_DeleteKey(key); |
| 2543 | genericSetKey(key->ctx->client,key->db,key->key,str,0,0); |
| 2544 | key->value = str; |
| 2545 | return REDISMODULE_OK; |
| 2546 | } |
| 2547 | |
| 2548 | /* Prepare the key associated string value for DMA access, and returns |
| 2549 | * a pointer and size (by reference), that the user can use to read or |
nothing calls this directly
no test coverage detected