FEATURE.SET
FEATURE.SET group entity feature value [feature value ...]
- Group
- Feature store
- Complexity
- O(F) where F is the number of features given
- Arity
- -5 (at least 5 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
The feature store keeps typed feature values for entities (users, items, sessions) in named feature groups, for low-latency reads at model inference time. FEATURE.SET writes the given features of entity, creating the
entity if needed (its other features keep their current or default values),
and records the time of the update.
Each value is read according to the feature’s type in the schema. Make sure
int64 and double values are valid numbers: a value that does not parse
is stored as 0. Feature names that are not in the schema are ignored.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Values written | Simple string OK |
Same |
Errors:
ERR group not foundif the group does not exist.ERR invalid value for feature 'name' (type)if a value does not fit the feature’s type, for exampleabcor1.5for anint64.ERR unknown feature 'name' for group 'group'if the group’s schema has no such feature.
On any of these errors nothing is written for that call, and the entity is not created.
ERR wrong number of arguments for 'feature.set' commandif no pair is given or a feature has no value.NOLICENSE feature-store requires a HotKV license. Contact sales@hotkv.comif your license does not include thefeature-storefeature.
Examples
Section titled “Examples”127.0.0.1:6379> FEATURE.SET user_features user:42 age 31 ctr 0.042 country DEOK127.0.0.1:6379> FEATURE.SET user_features user:42 ctr 0.051OKCompatibility
Section titled “Compatibility”HotKV-only command. Redis and Valkey have no equivalent.
See also
Section titled “See also”FEATURE.CREATE, FEATURE.GET, FEATURE.BATCH, FEATURE.SCHEMA, FEATURE.STATS, FEATURE.DROP, FEATURE.LIST, AI features guide
Was this page helpful?
Thanks for the feedback.