-
Notifications
You must be signed in to change notification settings - Fork 94
feat: add new commands to redis js and py docs #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds documentation for new Redis commands across Hash, Stream, Connection, and Bitmap categories for both TypeScript and Python SDKs.
Changes:
- Added documentation for new hash commands with expiration support (HGETDEL, HGETEX, HSETEX)
- Added documentation for new stream commands (XACKDEL, XDELEX) and enhanced XADD with auto-sequence number support
- Added CLIENT SETINFO command documentation for connection management
- Extended BITOP documentation with four new advanced operations (DIFF, DIFF1, ANDOR, ONE)
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| redis/sdks/ts/commands/hash/hgetdel.mdx | New command documentation for atomic get-and-delete hash operations |
| redis/sdks/ts/commands/hash/hgetex.mdx | New command documentation for getting hash fields with expiration management |
| redis/sdks/ts/commands/hash/hsetex.mdx | New command documentation for setting hash fields with expiration and conditional options |
| redis/sdks/ts/commands/stream/xdelex.mdx | New command documentation for extended stream entry deletion |
| redis/sdks/ts/commands/stream/xackdel.mdx | New command documentation for atomic acknowledge-and-delete operations |
| redis/sdks/ts/commands/stream/xadd.mdx | Updated to document auto-sequence number support (Redis 8+) |
| redis/sdks/ts/commands/connection/client_setinfo.mdx | New command documentation for setting client library information |
| redis/sdks/ts/commands/bitmap/bitop.mdx | Extended with documentation for four new bitwise operations |
| redis/sdks/ts/commands/overview.mdx | Updated command listing with new Connection group and new commands |
| redis/sdks/py/commands/hash/hgetdel.mdx | Python version of HGETDEL documentation |
| redis/sdks/py/commands/hash/hgetex.mdx | Python version of HGETEX documentation |
| redis/sdks/py/commands/hash/hsetex.mdx | Python version of HSETEX documentation |
| redis/sdks/py/commands/stream/xdelex.mdx | Python version of XDELEX documentation |
| redis/sdks/py/commands/stream/xackdel.mdx | Python version of XACKDEL documentation |
| redis/sdks/py/commands/stream/xadd.mdx | Updated Python XADD documentation with auto-sequence support |
| redis/sdks/py/commands/connection/client_setinfo.mdx | Python version of CLIENT SETINFO documentation |
| redis/sdks/py/commands/bitmap/bitop.mdx | Python version of extended BITOP documentation |
| redis/sdks/py/commands/overview.mdx | Updated Python command listing |
| docs.json | Updated navigation structure to include new command documentation pages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| redis.hset("user:123", values={"name": "John", "email": "john@example.com"}) | ||
|
|
||
| # Get fields and set expiration to 60 seconds | ||
| result = redis.hgetex("user:123", "name", "email", ex=60) | ||
| assert result == {"name": "John", "email": "john@example.com"} | ||
| ``` | ||
|
|
||
| ```py With PX (milliseconds) | ||
| redis.hset("session:abc", values={"token": "xyz123", "user": "john"}) | ||
|
|
||
| # Get fields and set expiration to 30000 milliseconds (30 seconds) | ||
| result = redis.hgetex("session:abc", "token", "user", px=30000) | ||
| assert result == {"token": "xyz123", "user": "john"} | ||
| ``` | ||
|
|
||
| ```py With EXAT (Unix timestamp in seconds) | ||
| import time | ||
|
|
||
| redis.hset("cache:data", "value", "cached") | ||
|
|
||
| # Set expiration to specific timestamp (1 hour from now) | ||
| future_time = int(time.time()) + 3600 | ||
| result = redis.hgetex("cache:data", "value", exat=future_time) | ||
| assert result == {"value": "cached"} | ||
| ``` | ||
|
|
||
| ```py With PXAT (Unix timestamp in milliseconds) | ||
| import time | ||
|
|
||
| redis.hset("temp:data", "info", "temporary") | ||
|
|
||
| # Set expiration to specific timestamp in milliseconds | ||
| future_time = int(time.time() * 1000) + 60000 # 1 minute from now | ||
| result = redis.hgetex("temp:data", "info", pxat=future_time) | ||
| assert result == {"info": "temporary"} | ||
| ``` | ||
|
|
||
| ```py With PERSIST | ||
| redis.hset("user:456", "name", "Jane") |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent hset API usage in examples. Line 46 uses values={"name": "John", "email": "john@example.com"} while lines 64, 75, and 84 use positional arguments like "value", "cached". While both forms may be valid in redis-py, using consistent patterns throughout the documentation would improve clarity. Consider standardizing on one approach across all examples.
| ``` | ||
|
|
||
| ```py Non-existent Fields | ||
| redis.hset("user:456", "name", "Jane") |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent hset API usage in examples. Lines 27 and 42 use values={"field": "value"} while line 58 uses positional arguments "name", "Jane". While both forms may be valid in redis-py, using consistent patterns throughout the documentation would improve clarity. Consider standardizing on one approach across all examples.
| redis.hset("user:456", "name", "Jane") | |
| redis.hset("user:456", values={"name": "Jane"}) |
| ### DIFF | ||
| A bit in the destination is set if it is set in **all** source bitmaps. This is equivalent to the intersection of all source bitmaps. | ||
|
|
||
| **Use Cases:** | ||
| - Finding common features across multiple datasets | ||
| - Identifying users present in all segments | ||
| - Intersection of multiple filters |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description of BITOP DIFF operation in this section appears to be incorrect. It states "A bit in the destination is set if it is set in all source bitmaps" which is actually the behavior of the AND operation, not a DIFF operation. The use cases listed (intersection, finding common features) also align with AND rather than DIFF. Please verify this description against the actual Redis 8.2+ documentation.
Hash Commands
HGETDEL - Get and delete hash fields atomically
HGETEX - Get hash fields with expiration support
HSETEX - Set hash fields with expiration support
Stream Commands
XDELEX - Extended delete for streams
XACKDEL - Acknowledge and delete stream entries
Connection Commands
CLIENT SETINFO - Set client library name and version information
BITOP
Four new operations added:
BITOP DIFF - A bit is set only if it's set in all source bitmaps
BITOP DIFF1 - A bit is set if it's set in the first key but not in any of the other keys
BITOP ANDOR - A bit is set if it's set in X and also in one or more of Y1, Y2, ...
BITOP ONE - A bit is set if it's set in exactly one source key
XADD
Now supports auto sequence numbers via -* syntax