You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(json): Ensure that JSON.GET returns Nil response (#3470)
* fix conflicts
* Fix JSON nil response handling
Ensure that JSON.GET returns redis.Nil for missing keys/paths,
making it consistent with other Redis commands.
- Restore proper nil detection logic in JSONCmd.readReply
- Add comprehensive test coverage for JSON nil scenarios
- Handle both non-existent keys and non-existent paths consistently
- Distinguish between empty arrays and nil responses
- Add documentation for Val() and Expanded() methods
Original work and problem identification by Nic Gibson.
Enhanced implementation with comprehensive testing and fixes
for the broken nil detection logic.
Fixes#2987
* Fix JSON nil response handling - align with Redis behavior
- Non-existent keys return redis.Nil (consistent with other Redis commands)
- Non-existent paths in existing keys return empty array '[]'
- Fix broken test that was using wrong doc1 reference
- Add comprehensive test coverage for JSON nil scenarios
This aligns with official Redis JSON.GET behavior:
- Missing keys should return nil error like other Redis commands
- Missing paths should return empty JSON array, not error
* Fix JSONDel tests
---------
Co-authored-by: Nic Gibson <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
0 commit comments