Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

FEATURE.SETAT

Last updated
FEATURE.SETAT group entity unix-ms feature value [feature value ...]
Group
Feature store
Complexity
O(F) where F is the number of features given
Arity
-6 (at least 6 words, counting the command name)
Flags
write, fast
Keys
first 1, last 1, step 1
HotKV Cloud
Performance and Scale
On-Premise
requires the feature-store license feature

FEATURE.SETAT is FEATURE.SET with the time to stamp the entity with, in Unix milliseconds, as updated_at_ms in FEATURE.GET. Use it to load history. Replicas, the append-only file and a replica that takes over keep the same update time as the primary.

Simple string OK in RESP2 and RESP3. Errors:

Error Cause
ERR invalid timestamp The time is not a positive number within 100 years of now.
ERR group not found The feature group does not exist.
ERR wrong number of arguments for 'feature.setat' command No feature and value pair.
NOLICENSE feature-store requires a HotKV license. Contact sales@hotkv.com The license does not include feature-store.
127.0.0.1:6379> FEATURE.CREATE users "user features" SCHEMA age int64 country string
OK
127.0.0.1:6379> FEATURE.SETAT users u1 1700000000000 age 31 country DE
OK
127.0.0.1:6379> FEATURE.GET users u1
1) 1) "age"
2) (integer) 31
3) "country"
4) "DE"
2) (integer) 1700000000000
3) (integer) 91069527033
127.0.0.1:6379> FEATURE.SETAT users u1 0 age 32
(error) ERR invalid timestamp
127.0.0.1:6379> FEATURE.SETAT users u1 -5 age 32
(error) ERR invalid timestamp
127.0.0.1:6379> FEATURE.SETAT users u1 99999999999999 age 32
(error) ERR invalid timestamp
127.0.0.1:6379> FEATURE.SETAT nogroup u1 1700000000000 age 31
(error) ERR group not found
127.0.0.1:6379> FEATURE.SETAT users u1 1700000000000
(error) ERR wrong number of arguments for 'feature.setat' command

The third element of the FEATURE.GET reply is the age of the entity in milliseconds, so it is large here: the entity was stamped with a time in 2023.

HotKV-only command. Redis and Valkey have no equivalent.

FEATURE.SET, FEATURE.GET, FEATURE.CREATE

In a cluster: AI engines in a cluster