Skip to content

Commit

Permalink
Update docs/data-types/streams.md
Browse files Browse the repository at this point in the history
Co-authored-by: David Dougherty <[email protected]>
  • Loading branch information
sav-norem and dwdougherty authored Aug 22, 2023
1 parent 4ee5a0c commit cd2e477
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/data-types/streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ However trimming with **MAXLEN** can be expensive: streams are represented by ma
XADD race:italy MAXLEN ~ 1000 * ... entry fields here ...
```

The `~` argument between the **MAXLEN** option and the actual count means, I don't really need this to be exactly 1000 items. It can be 1000 or 1010 or 1030, just make sure to save at least 1000 items. With this argument, the trimming is performed only when we can remove a whole node. This makes it much more efficient, and it is usually what you want. You'll note here that the client libraries have various implementations of this, For example, the Python client defaults to approximate and has to be explicitly set to a true length.
The `~` argument between the **MAXLEN** option and the actual count means, I don't really need this to be exactly 1000 items. It can be 1000 or 1010 or 1030, just make sure to save at least 1000 items. With this argument, the trimming is performed only when we can remove a whole node. This makes it much more efficient, and it is usually what you want. You'll note here that the client libraries have various implementations of this. For example, the Python client defaults to approximate and has to be explicitly set to a true length.

There is also the `XTRIM` command, which performs something very similar to what the **MAXLEN** option does above, except that it can be run by itself:

Expand Down

0 comments on commit cd2e477

Please sign in to comment.