Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
31491202
Commit
31491202
authored
Sep 24, 2020
by
Guy Korland
Committed by
Oran Agra
Oct 27, 2020
Browse files
Fix RedisModule_HashGet examples (#6697)
(cherry picked from commit
b464afb9
)
parent
26c1c601
Changes
1
Show whitespace changes
Inline
Side-by-side
src/module.c
View file @
31491202
...
@@ -2952,22 +2952,22 @@ int RM_HashSet(RedisModuleKey *key, int flags, ...) {
...
@@ -2952,22 +2952,22 @@ int RM_HashSet(RedisModuleKey *key, int flags, ...) {
* As with RedisModule_HashSet() the behavior of the command can be specified
* As with RedisModule_HashSet() the behavior of the command can be specified
* passing flags different than REDISMODULE_HASH_NONE:
* passing flags different than REDISMODULE_HASH_NONE:
*
*
* REDISMODULE_HASH_CFIELD: field names as null terminated C strings.
* REDISMODULE_HASH_CFIELD
S
: field names as null terminated C strings.
*
*
* REDISMODULE_HASH_EXISTS: instead of setting the value of the field
* REDISMODULE_HASH_EXISTS: instead of setting the value of the field
* expecting a RedisModuleString pointer to pointer, the function just
* expecting a RedisModuleString pointer to pointer, the function just
* reports if the field exists or not and expects an integer pointer
* reports if the field exists or not and expects an integer pointer
* as the second element of each pair.
* as the second element of each pair.
*
*
* Example of REDISMODULE_HASH_CFIELD:
* Example of REDISMODULE_HASH_CFIELD
S
:
*
*
* RedisModuleString *username, *hashedpass;
* RedisModuleString *username, *hashedpass;
* RedisModule_HashGet(mykey,"username",&username,"hp",&hashedpass, NULL);
* RedisModule_HashGet(mykey,
REDISMODULE_HASH_CFIELDS,
"username",&username,"hp",&hashedpass, NULL);
*
*
* Example of REDISMODULE_HASH_EXISTS:
* Example of REDISMODULE_HASH_EXISTS:
*
*
* int exists;
* int exists;
* RedisModule_HashGet(mykey,argv[1],&exists,NULL);
* RedisModule_HashGet(mykey,
REDISMODULE_HASH_EXISTS,
argv[1],&exists,NULL);
*
*
* The function returns REDISMODULE_OK on success and REDISMODULE_ERR if
* The function returns REDISMODULE_OK on success and REDISMODULE_ERR if
* the key is not an hash value.
* the key is not an hash value.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment