ZSET.F64
Sets a key to a double-precision floating-point value in the ZMap ordered key-value store.
Syntax
Section titled “Syntax”ZSET.F64 <key> <value> [NAMESPACE <path>]Arguments
Section titled “Arguments”key and value are positional. NAMESPACE is a keyword argument and comes after them.
| Argument | Type | Required | Description |
|---|---|---|---|
key | bytes | Yes | The key to set. |
value | double | Yes | A finite IEEE-754 double-precision value. |
NAMESPACE | string | No | Run this command in the given namespace instead of the session’s current one. The namespace must exist. The session’s current namespace does not change. |
Return Value
Section titled “Return Value”Simple string: OK on success.
Behavior
Section titled “Behavior”ZSET.F64 writes a typed 64-bit floating-point value for a key in the ZMap subspace of the session’s current namespace.
The value is encoded as 8 bytes in little-endian IEEE-754 double format, the same encoding used by ZINC.F64 and read
by ZGET.F64.
If the key already exists, its value is overwritten silently.
The value must be a finite double. NaN and Infinity are rejected. Negative zero (-0.0) is normalized to 0.0.
The command supports two transaction modes:
- Auto-commit (one-off): When no explicit transaction is active, Kronotop creates a transaction, performs the write, and commits it immediately. This is the default mode.
- Explicit transaction: When a
BEGINhas been issued, the write is staged in the current transaction and only persists whenCOMMITis called.
All data is scoped to a namespace: the session’s active one, or the one given with NAMESPACE. The same key in
different namespaces refers to different entries.
Errors
Section titled “Errors”Argument errors:
| Error Code | Error message | Cause |
|---|---|---|
ERR | wrong number of arguments for 'ZSET. | - |
ERR | value is not a double or out of range | - |
ERR | Invalid value: must be a finite IEEE-754 double | The value is NaN or Infinity. |
ERR | Unknown '<keyword>' argument | - |
ERR | NAMESPACE argument must be followed by a namespace | - |
Namespace errors:
| Error Code | Error message | Cause |
|---|---|---|
NOSUCHNAMESPACE | No such namespace: '<path>' | - |
NAMESPACEBEINGREMOVED | Namespace '<path>' is being removed | - |
Examples
Section titled “Examples”Set a floating-point value:
> ZSET.F64 price 19.99OK
> ZGET.F64 price(double) 19.99Overwrite an existing value:
> ZSET.F64 price 19.99OK
> ZSET.F64 price 24.99OK
> ZGET.F64 price(double) 24.99NaN rejection:
> ZSET.F64 price NaN(error) ERR Invalid value: must be a finite IEEE-754 doubleUse within an explicit transaction:
> BEGINOK
> ZSET.F64 tx-price 42.42OK
> COMMITOK
> ZGET.F64 tx-price(double) 42.42