# FEATURE.SETAT

> Write feature values for an entity and stamp the entity with a time you give, in Unix milliseconds.

URL: https://docs.hotkv.com/commands/feature-setat/

```
FEATURE.SETAT group entity unix-ms feature value [feature value ...]
```

- Group: Feature store
- Complexity: O(F) where F is the number of features given
- HotKV Cloud: Performance and Scale plans
- On-Premise: requires the feature-store license feature

`FEATURE.SETAT` is [FEATURE.SET](https://docs.hotkv.com/commands/feature-set/index.md) with the time to stamp
the entity with, in Unix milliseconds, as `updated_at_ms` in
[FEATURE.GET](https://docs.hotkv.com/commands/feature-get/index.md). Use it to load history. Replicas, the
append-only file and a replica that takes over keep the same update time as the
primary.

## Return value

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`. |

## Examples

```
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.

## Compatibility

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

## See also

[FEATURE.SET](https://docs.hotkv.com/commands/feature-set/index.md), [FEATURE.GET](https://docs.hotkv.com/commands/feature-get/index.md),
[FEATURE.CREATE](https://docs.hotkv.com/commands/feature-create/index.md)

In a cluster: [AI engines in a cluster](https://docs.hotkv.com/clustering/ai-engines/index.md)