In the following code, the response for "entries-read" can be either an integer or null (nil).

PR: https://github.com/redis/redis/pull/9127

https://github.com/redis/redis/blob/11cf5cbdccee0f11f5a35e171ca78a767e18773c/src/t_stream.c#L3732-L3738

Before I review the source code of redis-server.....I have checked the redis-doc (https://redis.io/commands/xinfo-stream/) and found no specific explanation for "entries-read". Based on the response examples provided in redis-doc, I believe it should be of type integer (resp[:]), but I encountered the strange "(nil)" response.

How can I determine when the redis-server will respond with "(nil)"? When should I use default values (e.g., int=0)? It can become quite complex if I have to look into the redis-server source code every time.

Comment From: zuiderkwast

The documentation is not perfect. If you find something that is not correct or not clear in documentation, feel free to open a PR in the redis-doc repo. Each command has a markdown file, such as this one:

https://github.com/redis/redis-doc/blob/master/commands/xinfo-stream.md