Commit c593d97d authored by Georgios Bitzes's avatar Georgios Bitzes
Browse files

docs: add documentation on HGET / HSET

parent 6672d82c
Pipeline #1924369 failed with stages
in 107 minutes and 54 seconds
......@@ -17,6 +17,7 @@ for earnest only if it has a good chance of winning.
- Show resilvering progress in ``raft-info``.
- Checkpoint creation through ``quarkdb-checkpoint`` will now fail if a different
physical filesystem is specified.
- RPMs now available for CentOS 8.
Many thanks to Franck Eyraud (JRC) for the bug report concerning erroneous ``MANIFEST``-related
warning.
......
# HGET key field
Given the key of a hash, retrieves the contents found in the given field. If the
key, or corresponding field does not exist, the empty string is returned.
If the key holds a different type other than hash already, an error is returned.
*Cost:* Two lookups.
```
127.0.0.1:4445> hset myhash f1 v1
(integer) 1
127.0.0.1:4445> hset myhash f2 v2
(integer) 1
127.0.0.1:4445> hget myhash f1
"v1"
127.0.0.1:4445> hget myhash f2
"v2"
```
# HSET key field value
Given the key of a hash, sets the value of the corresponding field to the given
contents.
Return value: The number of newly created fields.
If the key holds a different type other than hash already, an error is returned.
*Cost:* Two lookups + two writes.
```
127.0.0.1:4445> hset myhash f1 v1
(integer) 1
127.0.0.1:4445> hset myhash f1 v2
(integer) 0
127.0.0.1:4445> hget myhash f1
"v2"
```
......@@ -55,12 +55,15 @@ nav:
- Membership updates: membership.md
- Release notes: release-notes.md
- Command reference:
- String types:
- GET: ref/get.md
- SET: ref/set.md
- Authentication:
- AUTH: ref/auth.md
- HMAC signing challenges: ref/hmac-signing-challenges.md
- String types:
- GET: ref/get.md
- SET: ref/set.md
- Hash types:
- HGET: ref/hget.md
- HSET: ref/hset.md
- Advanced topics:
- Raft basics: raft.md
- Write path: write-path.md
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment