Skip to content

Ensure that JSON.GET returns Nil response #3467

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

Closed
wants to merge 231 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
215d53e
Ensure that JSON.GET returns Nil response
nic-gibson Apr 16, 2024
603b0ba
Fix typo in comment (#2972)
deferdeter Apr 16, 2024
b64b22e
Adding BitfieldRo in BitMapCmdable interface (#2962)
akash14darshan Apr 21, 2024
8f17cba
Fix XGroup first pos key (#2983)
daviddzxy Apr 27, 2024
7360090
Handle IPv6 in isMovedError (#2981)
daviddzxy Apr 28, 2024
d453af5
Remove skipping span creation by checking parent spans (#2980)
XSAM May 10, 2024
bfea813
fix: fix #2681 (#2998)
monkey92t May 29, 2024
4a1319f
Release/v9.5.3 (#3018)
vmihailenco Jun 7, 2024
0ef8e52
Change redis version from 7.2 to 7.4 in makefile (#3034)
ofekshenawa Jun 19, 2024
8409fa5
Support Hash-field expiration commands (#2991)
ofekshenawa Jun 19, 2024
f95779d
Added test case for CLIENT KILL with MAXAGE option (#2971)
vladvildanov Jun 19, 2024
f7411e0
Support NOVALUES parameter for HSCAN (#2925)
gerzse Jun 19, 2024
ef84e83
remove tests from RE (#3035)
ofekshenawa Jun 19, 2024
0e5453d
Add support for XREAD last entry (#3005)
b1ron Jun 20, 2024
9edb041
chore(deps): bump golang.org/x/net in /example/otel (#3000)
dependabot[bot] Jun 21, 2024
3d4bc20
Add `(*StatusCmd).Bytes()` method (#3030)
haines Jun 21, 2024
31068bb
RediSearch Support (#2801)
ofekshenawa Jun 26, 2024
41a0655
chore(deps): bump rojopolis/spellcheck-github-actions (#3028)
dependabot[bot] Jun 27, 2024
26f69c6
Change monitor test to run manually (#3041)
ofekshenawa Jul 2, 2024
8bfdb82
Update pubsub.go (#3042)
immersedin Jul 5, 2024
f5a789a
fix node routing in slotClosestNode (#3043)
srikar-jilugu Jul 10, 2024
711fe9f
Support Hash-field expiration for 7.4 CE RC2 (#3040)
ofekshenawa Jul 10, 2024
8f4d4f7
Support Hash-field expiration commands in Pipeline & Fix HExpire HExp…
tzongw Jul 11, 2024
71ac8c8
TimeSeries insertion filters for close samples (#3003)
ofekshenawa Jul 11, 2024
5166520
add test for tls connCheck #3025 (#3047)
naiqianz Jul 12, 2024
eb4d5f0
Avoid unnecessary retry delay following MOVED and ASK redirection (#3…
LINKIWI Jul 13, 2024
d81c199
chore(deps): bump golangci/golangci-lint-action from 4 to 6 (#2993)
dependabot[bot] Jul 13, 2024
8408e97
Support RediSearch empty values (#3053)
ofekshenawa Jul 17, 2024
be3e4f0
Add tests for search GEO (#3051)
ofekshenawa Jul 17, 2024
bc524fe
Test RediSearch dialect 4 (#3052)
ofekshenawa Jul 17, 2024
d5d2139
Add tests case with FLOAT16 and BFLOAT16 vectors (#3054)
ofekshenawa Jul 17, 2024
91870a1
chore(deps): bump rojopolis/spellcheck-github-actions (#3067)
dependabot[bot] Jul 23, 2024
db7a9e9
Retract versions 9.5.3 and 9.5.4 (#3068)
ofekshenawa Jul 24, 2024
4f7b394
Updated module version that points to retracted package version (#3074)
vladvildanov Jul 31, 2024
4c0e679
Add test coverage reporting and Codecov badge (#3055)
ofekshenawa Sep 3, 2024
2f4b81a
DOC-4213 string code examples (#3102)
andy-stark-redis Sep 6, 2024
aafbf70
properly retract v9.5.3 of redisotel and other extra packages (#3108)
ipechorin Sep 11, 2024
83e7f56
Support Resp 3 Redis Search Unstable Mode (#3098)
ofekshenawa Sep 12, 2024
b6e3877
Doc 4226 hash tces (#3106)
andy-stark-redis Sep 12, 2024
6f677c9
DOC-4230 list doc code examples (#3110)
andy-stark-redis Sep 12, 2024
1fc50a2
DOC-4231 added set datatype examples (#3111)
andy-stark-redis Sep 12, 2024
e661d8e
DOC-4229 sorted set code examples (#3113)
andy-stark-redis Sep 12, 2024
8a1da58
DOC-4241 added t-digest examples (#3123)
andy-stark-redis Sep 25, 2024
d1f6595
DOC-4234 added bitmap examples (#3124)
andy-stark-redis Sep 25, 2024
5946de1
DOC-4228 JSON code examples (#3114)
andy-stark-redis Sep 26, 2024
9c8a0a9
DOC-4237 added Bloom filter examples (#3115)
andy-stark-redis Sep 26, 2024
c8e4a1e
Fix Flaky Test: should handle FTAggregate with Unstable RESP3 Search …
ofekshenawa Sep 26, 2024
c64e947
Remove direct read from TLS underlying conn (#3138)
rentziass Oct 7, 2024
fab9d4b
DOC-4238 added Cuckoo filter examples (#3116)
andy-stark-redis Oct 9, 2024
30f193d
DOC-4236 added HyperLogLog examples (#3117)
andy-stark-redis Oct 9, 2024
b1ae5f6
DOC-4239 added Count-min sketch examples (#3118)
andy-stark-redis Oct 9, 2024
6bf55af
DOC-4235 added bitfield examples (#3125)
andy-stark-redis Oct 9, 2024
392b9ae
DOC-4240 added Top-K examples (#3119)
andy-stark-redis Oct 9, 2024
3d780f7
DOC-4233 added geospatial examples (#3126)
andy-stark-redis Oct 9, 2024
cecf030
DOC-4322 added HSET/HGET command page examples (#3140)
andy-stark-redis Oct 9, 2024
7fbbb5b
DOC-4323 added INCR command example (#3141)
andy-stark-redis Oct 9, 2024
891bb2a
DOC-4324 added ZADD and ZRANGE command examples (#3142)
andy-stark-redis Oct 9, 2024
7641748
DOC-4328 added DEL, EXPIRE, and TTL command examples (#3143)
andy-stark-redis Oct 9, 2024
a7a0af2
fix conflicts
ofekshenawa Aug 10, 2025
d592eed
Fix field name spellings (#3132)
andy-stark-redis Oct 14, 2024
53102b6
Updated package version (#3158)
vladvildanov Oct 15, 2024
d0bd739
DOC-4232 stream code examples (#3128)
andy-stark-redis Oct 23, 2024
1260350
DOC-4345 added JSON samples for home page (#3183)
andy-stark-redis Nov 6, 2024
73b4f38
Support TimeSeries commands with RESP 2 protocol (#3184)
ofekshenawa Nov 13, 2024
92b675f
Support Probabilistic commands with RESP 2 protocol (#3176)
ofekshenawa Nov 13, 2024
92634e1
Add guidance on unstable RESP3 support for RediSearch commands to REA…
ofekshenawa Nov 13, 2024
4f48200
Eliminate redundant dial mutex causing unbounded connection queue con…
LINKIWI Nov 20, 2024
7cf9f53
Only check latencies once every 10 seconds with `routeByLatency` (#2795)
justinmir Nov 20, 2024
f2fa1ce
Recognize byte slice for key argument in cluster client hash slot com…
LINKIWI Nov 21, 2024
dec9e1e
chore(deps): bump rojopolis/spellcheck-github-actions (#3188)
dependabot[bot] Nov 21, 2024
cfbb6f5
SortByWithCount FTSearchOptions fix (#3201)
Cgol9 Dec 5, 2024
cc152fa
chore(deps): bump codecov/codecov-action from 4 to 5 (#3196)
dependabot[bot] Dec 5, 2024
450b268
Test against Redis CE (#3191)
ofekshenawa Dec 16, 2024
085338f
Fix Redis CE tests (#3233)
ofekshenawa Jan 15, 2025
b167cb1
DOC-4560 pipelines/transactions example (#3202)
andy-stark-redis Jan 17, 2025
e6e323f
DOC-4449 hash command examples (#3229)
andy-stark-redis Jan 17, 2025
8863e40
Order slices of strings to be sure what the output of Println in doct…
ndyakov Jan 20, 2025
7f5c356
fix(command): add missing `io-thread` key in `client info` (#3244)
ndyakov Jan 23, 2025
7fd6c5b
chore(deps): bump golang.org/x/net in /example/otel (#3243)
dependabot[bot] Jan 29, 2025
e45406f
DOC-4444 server management command examples (#3235)
andy-stark-redis Jan 31, 2025
cab668d
fix(tests): enable testing with Redis CE 8.0-M4 in CI (#3247)
ndyakov Jan 31, 2025
12b0122
Fix race condition in clusterNodes.Addrs() (#3219)
shawnwgit Feb 3, 2025
c0235cc
feat(tests): validate that ConfigSet and ConfigGet work with Modules …
ndyakov Feb 3, 2025
b83216f
chore: fix some comments (#3226)
zhuhaicity Feb 3, 2025
07548a6
chore(deps): bump github.com/cespare/xxhash/v2 from 2.2.0 to 2.3.0 (#…
dependabot[bot] Feb 4, 2025
40ed9dc
feat(options): add skip_verify param (#3216)
Feb 4, 2025
d4ddfe9
feat(command): add ACL commands, validate module categories exist (#3…
ndyakov Feb 5, 2025
ed8b629
DOC-4734 added geo indexing examples (#3240)
andy-stark-redis Feb 7, 2025
52672e5
DOC-4799 fixed capped list example (#3260)
andy-stark-redis Feb 7, 2025
85bccdc
DOC-4331 added full text query examples (#3256)
andy-stark-redis Feb 7, 2025
3c78310
DOC-4332 added geo query examples (#3257)
andy-stark-redis Feb 7, 2025
c42db42
DOC-4300 added exact match examples (#3251)
andy-stark-redis Feb 7, 2025
e4173a4
chore(deps): bump rojopolis/spellcheck-github-actions (#3227)
dependabot[bot] Feb 7, 2025
7816fdd
fix(aggregate, search): ft.aggregate bugfixes (#3263)
ndyakov Feb 7, 2025
162b526
fix: add unstableresp3 to cluster client (#3266)
ndyakov Feb 7, 2025
01fd453
fix: flaky ClientKillByFilter test (#3268)
ndyakov Feb 7, 2025
5fdab23
DOC-4335 added aggregate query examples (#3259)
andy-stark-redis Feb 10, 2025
e59b185
test: add test for `info` in RCE 8 (#3269)
ndyakov Feb 10, 2025
9a37279
test(redisotel): rename redisotel_test.go to tracing_test.go and add …
flc1125 Feb 10, 2025
f83f922
chore(deps): update github.com/cespare/xxhash/v2 to v2.3.0 (#3265)
flc1125 Feb 10, 2025
18bc8ed
Reinstate read-only lock on hooks access in dialHook (#3225)
LINKIWI Feb 11, 2025
7b40016
use limit when limitoffset is zero (#3275)
ndyakov Feb 14, 2025
61391aa
fix: linter configuration (#3279)
ndyakov Feb 18, 2025
82be3f4
chore(deps): bump rojopolis/spellcheck-github-actions (#3276)
dependabot[bot] Feb 18, 2025
1814bae
fix(search&aggregate):fix error overwrite and typo #3220 (#3224)
bitsark Feb 20, 2025
926d6f1
move regexp.MustCompile close to call (#3280)
alingse Feb 20, 2025
e010f2e
DOC-4329 added range query examples (#3252)
andy-stark-redis Feb 20, 2025
26e2430
fix: nil pointer dereferencing in writeArg (#3271)
aliforever Feb 20, 2025
4f9550f
fix: race slice for list function of ring client (#2931)
rfyiamcool Feb 20, 2025
0bd9d4a
V9.7.1 -> master (#3287)
ndyakov Feb 24, 2025
0a76a35
Add test codes for search_commands.go (#3285)
tomfrombayesians Feb 26, 2025
eaaac08
feat: support Elasticache cluster mode by introducing IsClusterMode c…
reeshijoshi Feb 26, 2025
4d075dd
fix(redisotel): fix the situation of reporting spans multiple times (…
flc1125 Feb 27, 2025
4451928
feat: Enable CI for Redis CE 8.0 (#3274)
ndyakov Feb 28, 2025
57704a3
feat: add hstrlen command for hash (#2843)
rfyiamcool Mar 4, 2025
d3d98f1
fix(test): sort results in example test (#3292)
ndyakov Mar 4, 2025
5c5ddc9
fix: Fixed issue with context cancelled error leading to connection s…
EXPEbdodla Mar 5, 2025
7f14117
add readOnly on failover opts (#3281)
smilad Mar 6, 2025
6572f0f
Update README.md
dmaier-redislabs Mar 12, 2025
b6b2d7e
Enable dialect 2 on default (#3213)
ofekshenawa Mar 13, 2025
f3979d7
Set client name in HELLO RESP handshake (#3294)
LINKIWI Mar 13, 2025
28d0d08
fix: connection pool timeout, increase retries (#3298)
monkey92t Mar 14, 2025
3bb6b76
chore(deps): bump golangci/golangci-lint-action from 6.5.0 to 6.5.1 (…
dependabot[bot] Mar 17, 2025
cc3b6e7
chore: use redis 8 ce m05 (#3304)
ndyakov Mar 18, 2025
f1fa67a
fix(tracing): show the whole command rather than truncated version of…
rodneyosodo Mar 18, 2025
94288e8
Add vector types INT8 and UINT8 test (#3299)
ofekshenawa Mar 18, 2025
2ff957a
DOC-4494 SADD and SMEMBERS command examples (#3242)
andy-stark-redis Mar 19, 2025
a8e0b26
fix: handle network error on SETINFO (#3295) (CVE-2025-29923)
ndyakov Mar 19, 2025
cfa9ab9
chore(deps): bump golang.org/x/net in /example/otel (#3308)
dependabot[bot] Mar 19, 2025
70880f2
release 9.7.3, retract 9.7.2 (#3314) (#3315)
ndyakov Mar 21, 2025
d6c2270
chore(deps): bump golangci/golangci-lint-action from 6.5.1 to 6.5.2 (…
dependabot[bot] Mar 24, 2025
732a7b6
Support new hash commands: HGETDEL, HGETEX, HSETEX (#3305)
ofekshenawa Mar 24, 2025
2ad1eb1
Add FailoverClusterClient support for Universal client (#2794)
a-menshchikov Mar 24, 2025
ba1f754
chore: disable verifying golangci configuration (#3319)
ndyakov Mar 24, 2025
ad77123
Make MASTERDOWN a retriable error in RedisCluster client (#3164)
justinmir Mar 24, 2025
de41868
Bound connection pool background dials to configured dial timeout (#3…
LINKIWI Mar 24, 2025
9ef6db1
Drop RedisGears (aka. Triggers and Functions) (#3321)
ndyakov Mar 24, 2025
38ce817
added `Do` method for raw query by single conn from `pool.Conn()` (#3…
oleglacto Mar 24, 2025
0a22603
Feature more prominently how to enable OpenTelemetry instrumentation …
nikolaydubina Mar 25, 2025
593d874
Sync master with v9.8.0-beta.1 (#3322)
ndyakov Mar 25, 2025
01b19ff
DOC-4464 examples for llen, lpop, lpush, lrange, rpop, and rpush (#3234)
andy-stark-redis Mar 28, 2025
ef7f46a
update pubsub.go (#3329)
liushuangls Apr 3, 2025
501d535
use 8.0-RC1 (#3330)
ndyakov Apr 3, 2025
40e6c90
drop ft.profile that was never enabled (#3323)
ndyakov Apr 3, 2025
4e6dd15
chore(deps): bump rojopolis/spellcheck-github-actions (#3336)
dependabot[bot] Apr 7, 2025
ab8deac
Fix FT.Search Limit argument and add CountOnly argument for limit 0 0…
ofekshenawa Apr 15, 2025
41b4985
fix add missing command in interface (#3344)
ndyakov Apr 15, 2025
e2d1cd5
Use DB option in NewFailoverClusterClient (#3342)
khasanovbi Apr 15, 2025
7f9db6d
DOC-5102 added CountOnly search example for docs (#3345)
andy-stark-redis Apr 15, 2025
e9570a3
Add integration tests for Redis 8 behavior changes in Redis Search (…
ofekshenawa Apr 16, 2025
1284ebd
Use correct slot for COUNTKEYSINSLOT command (#3327)
khasanovbi Apr 16, 2025
053f2b2
Ensure context isn't exhausted via concurrent query as opposed to sen…
gnpaone Apr 16, 2025
dbe3f50
fix: better error handling when fetching the master node from the sen…
ndyakov Apr 17, 2025
e2b230c
docs: fix documentation comments (#3351)
ChildnodeGambino Apr 22, 2025
2872e0d
DOC-5111 added hash search examples (#3357)
andy-stark-redis Apr 22, 2025
4f43d86
fix: Fix panic caused when arg is nil (#3353)
frankxjkuang Apr 23, 2025
462175e
Update README.md, use redis discord guild (#3331)
ndyakov Apr 23, 2025
b388088
update HExpire command documentation (#3355)
ofekshenawa Apr 23, 2025
b1ba4f7
feat: func isEmptyValue support time.Time (#3273)
gh73962 Apr 28, 2025
bfcf517
fix: `PubSub` isn't concurrency-safe (#3360)
cxljs Apr 29, 2025
5575837
migrate golangci-lint config to v2 format (#3354)
ofekshenawa Apr 29, 2025
b583d95
chore(ci): Use redis 8 rc2 image. (#3361)
ndyakov Apr 29, 2025
64390f2
feat(options): panic when options are nil (#3363)
ndyakov Apr 30, 2025
050bc05
chore(deps): bump golangci/golangci-lint-action from 7.0.0 to 8.0.0 (…
dependabot[bot] May 5, 2025
f1ca486
feat: add more stats for otel (#2930)
rfyiamcool May 7, 2025
8e010d0
chore(release): sync master after releasing V9.8.0 (#3365)
ndyakov May 7, 2025
9db5abe
feat: add connection waiting statistics (#2804)
lzakharov May 7, 2025
289744d
ci(redis): update to 8.0.1 (#3372)
ndyakov May 8, 2025
a8e958b
utils: export ParseFloat and MustParseFloat wrapping internal utils (…
ofekshenawa May 9, 2025
a2fc559
feat: add ParseFailoverURL (#3362)
cxljs May 15, 2025
f2818c7
test(util): add unit tests for Atoi, ParseInt, ParseUint, and ParseFl…
iamamirsalehi May 15, 2025
7265b22
chore: optimize function `ReplaceSpaces` (#3383)
cxljs May 19, 2025
81bd24d
chore: remove unused param (#3382)
cxljs May 19, 2025
e25a391
Export pool errors for public consumption (#3380)
LINKIWI May 19, 2025
27c6e8b
perf: avoid unnecessary copy operation (#3376)
cxljs May 19, 2025
46da738
Unit test for pool acquisition timeout (#3381)
LINKIWI May 19, 2025
368a1c7
chore: remove unused param (#3384)
cxljs May 20, 2025
27ab642
xinfo-groups: support nil lag in XINFO GROUPS (#3369)
ofekshenawa May 21, 2025
7423351
fix: prevent routing reads to loading slave nodes (#3370)
ofekshenawa May 21, 2025
6e822c0
chore(deps): bump rojopolis/spellcheck-github-actions (#3389)
dependabot[bot] May 27, 2025
062685d
chore: set the default value for the `options.protocol` in the `init(…
cxljs May 27, 2025
1e895f6
feat: Introducing StreamingCredentialsProvider for token based authen…
ndyakov May 27, 2025
b50d0ad
feat(ring): add GetShardClients and GetShardClientForKey methods to R…
DengY11 May 27, 2025
ebc18f0
release(go-redis): v9.9.0 (#3390)
ndyakov May 27, 2025
4612195
Update RELEASE-NOTES.md (#3391)
ndyakov May 28, 2025
8b8ff5a
chore(tests): add the missing NewFloatSliceResult for testing (#3393)
AndBobsYourUncle Jun 3, 2025
bd9ec10
feat: support vectorset (#3375)
cxljs Jun 5, 2025
d5afd74
DOC-5078 vector set examples (#3394)
andy-stark-redis Jun 6, 2025
c37906c
chore(release): Update release notes and versions for v9.10.0 (#3395)
ndyakov Jun 6, 2025
d591c39
fix: insert entry during iterating over a map (#3398)
cxljs Jun 9, 2025
3c00562
fix: check if the shard exists to avoid returning nil (#3396)
cxljs Jun 9, 2025
9310da8
perf: reduce unnecessary memory allocation (#3399)
cxljs Jun 9, 2025
d9a11ab
test: refactor TestBasicCredentials using table-driven tests (#3406)
iamamirsalehi Jun 16, 2025
5920b3b
chore: remove a redundant method (#3401)
cxljs Jun 16, 2025
82751d6
chore(ci): update CI redis builds (#3407)
ndyakov Jun 16, 2025
8319098
fix(txpipeline): should return error on multi/exec on multiple slots …
ndyakov Jun 18, 2025
61200f7
[CAE-1046] fix(loading): cache the loaded flag for slave nodes (#3410)
ndyakov Jun 18, 2025
4de2ffe
feat: optimize connection pool waitTurn (#3412)
twz915 Jun 20, 2025
ff78daa
chore(deps): bump rojopolis/spellcheck-github-actions (#3414)
dependabot[bot] Jun 23, 2025
1e38046
DOC-5229 probabilistic data type examples (#3413)
andy-stark-redis Jun 23, 2025
d2bd31c
fix(txpipeline): keyless commands should take the slot of the keyed (…
ndyakov Jun 24, 2025
ad69df0
feat(redisotel): add WithCallerEnabled option (#3415)
boekkooi-impossiblecloud Jun 24, 2025
4ff1bbe
feat(client): Add CredentialsProvider field to UniversalOptions (#2927)
dcherubini Jun 24, 2025
8bb52c3
Set correct cluster slot for scan commands, similarly to Java's Jedis…
pete-woods Jun 24, 2025
a0e91bc
chore(release): v9.11.0 (#3416)
ndyakov Jun 24, 2025
c2e2126
feat(bitop): add support for the new bitop operations (#3409)
htemelski-redis Jul 2, 2025
705750e
fix: Ring.Pipelined return dial timeout error (#3403)
smnvdev Jul 3, 2025
7a03eb5
DOC-4344 document quickstart examples (#3426)
andy-stark-redis Jul 11, 2025
0d08e27
fix: `errors.Join` requires Go 1.20 or later (#3442)
cxljs Jul 22, 2025
f2d03dc
feat: Add "skip_verify" to Sentinel (#3428)
jouir Jul 22, 2025
5c8d669
feat(otel): add closing support to otel metrics instrumentation (#3444)
rokn Jul 24, 2025
2067991
chore(ci): bumped redis 8.2 version used in the CI/CD (#3451)
htemelski-redis Jul 30, 2025
e6ea005
Added new stream commands (#3450)
htemelski-redis Jul 31, 2025
74a7987
VSIM add `EPSILON` option (#3454)
cxljs Jul 31, 2025
193d5a0
fix(search): return results even if doc is empty (#3457)
ndyakov Jul 31, 2025
3029f7c
chore(ci): Add 8.2 rc2 pre build for CI (#3459)
ndyakov Aug 1, 2025
cb48450
feat(search): Add VAMANA vector type to RediSearch (#3449)
ofekshenawa Aug 1, 2025
bd8e9b5
Improve stale issue workflow (#3458)
elena-kolevska Aug 4, 2025
44c8070
feat(proto): add configurable buffer sizes for Redis connections (#3453)
ofekshenawa Aug 4, 2025
c568225
chore(tests): Add VAMANA compression algorithm tests (#3461)
ofekshenawa Aug 4, 2025
5548714
chore(doc): DOC-5472 time series doc examples (#3443)
andy-stark-redis Aug 4, 2025
c686865
feat(search): Add Query Builder for RediSearch commands (#3436)
ofekshenawa Aug 4, 2025
6f1aac4
chore(release): 9.12.0-beta.1 (#3460)
ndyakov Aug 4, 2025
bbadd65
chore(doc): improve code readability (#3446)
cxljs Aug 4, 2025
d0717e5
chore(github): merges into one job with two steps (#3463)
elena-kolevska Aug 5, 2025
1aa1d84
feat(ring): specify custom health check func via HeartbeatFn option (…
strobil Aug 5, 2025
ef444ea
fix(redisotel): fix buggy append in reportPoolStats (#3122)
wzy9607 Aug 5, 2025
51f6fcc
feat: recover addIdleConn may occur panic (#2445)
monkey92t Aug 5, 2025
990de39
chore(release): 9.12.0 / redis 8.2 (#3464)
ndyakov Aug 5, 2025
c592059
fix conflicts
ofekshenawa Aug 10, 2025
db309cf
Ensure that JSON.GET returns Nil response
nic-gibson Aug 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions json.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (cmd *JSONCmd) SetVal(val string) {
cmd.val = val
}

// Val returns the result of the JSON.GET command as a string.
func (cmd *JSONCmd) Val() string {
if len(cmd.val) == 0 && cmd.expanded != nil {
val, err := json.Marshal(cmd.expanded)
Expand All @@ -100,6 +101,7 @@ func (cmd *JSONCmd) Result() (string, error) {
return cmd.Val(), cmd.Err()
}

// Expanded returns the result of the JSON.GET command as unmarshalled JSON.
func (cmd *JSONCmd) Expanded() (interface{}, error) {
if len(cmd.val) != 0 && cmd.expanded == nil {
err := json.Unmarshal([]byte(cmd.val), &cmd.expanded)
Expand All @@ -118,6 +120,11 @@ func (cmd *JSONCmd) readReply(rd *proto.Reader) error {
return Nil
}

// Handle other base command errors
if cmd.baseCmd.Err() != nil {
return cmd.baseCmd.Err()
}

if readType, err := rd.PeekReplyType(); err != nil {
return err
} else if readType == proto.RespArray {
Expand All @@ -127,6 +134,12 @@ func (cmd *JSONCmd) readReply(rd *proto.Reader) error {
return err
}

// Empty array could indicate no results found for JSON path
if size == 0 {
cmd.val = ""
return Nil
}

expanded := make([]interface{}, size)

for i := 0; i < size; i++ {
Expand All @@ -141,6 +154,7 @@ func (cmd *JSONCmd) readReply(rd *proto.Reader) error {
return err
} else if str == "" || err == Nil {
cmd.val = ""
return Nil
} else {
cmd.val = str
}
Expand Down
52 changes: 52 additions & 0 deletions json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ var _ = Describe("JSON Commands", Label("json"), func() {
Expect(err).NotTo(HaveOccurred())
Expect(res).To(Equal("OK"))

resArr, err := client.JSONArrIndex(ctx, "doc1", "$.store.book[?(@.price<10)].size", 20).Result()
Expect(err).NotTo(HaveOccurred())
Expect(resArr).To(Equal([]int64{1, 2}))

res, err = client.JSONGetWithArgs(ctx, "get3", &redis.JSONGetArgs{Indent: "-"}).Result()
Expect(err).NotTo(HaveOccurred())
Expect(res).To(Equal(`{-"a":1,-"b":2}`))
Expand Down Expand Up @@ -673,6 +677,54 @@ var _ = Describe("JSON Commands", Label("json"), func() {
Expect(cmd2.Val()[0]).To(Or(Equal([]interface{}{"boolean"}), Equal("boolean")))
})
})

Describe("JSON Nil Handling", func() {
It("should return redis.Nil for non-existent key", func() {
_, err := client.JSONGet(ctx, "non-existent-key", "$").Result()
Expect(err).To(Equal(redis.Nil))
})

It("should return redis.Nil for non-existent path in existing key", func() {
err := client.JSONSet(ctx, "test-key", "$", `{"a": 1, "b": "hello"}`).Err()
Expect(err).NotTo(HaveOccurred())

_, err = client.JSONGet(ctx, "test-key", "$.nonexistent").Result()
Expect(err).To(Equal(redis.Nil))
})

It("should distinguish empty array from nil", func() {
err := client.JSONSet(ctx, "test-key", "$", `{"arr": [], "obj": {}}`).Err()
Expect(err).NotTo(HaveOccurred())

// Empty array should return the array, not nil
val, err := client.JSONGet(ctx, "test-key", "$.arr").Result()
Expect(err).NotTo(HaveOccurred())
Expect(val).To(Equal("[[]]"))

// Non-existent field should return nil
_, err = client.JSONGet(ctx, "test-key", "$.missing").Result()
Expect(err).To(Equal(redis.Nil))
})

It("should handle multiple paths with mixed results", func() {
err := client.JSONSet(ctx, "test-key", "$", `{"a": 1, "b": 2}`).Err()
Expect(err).NotTo(HaveOccurred())

// Path that exists
val, err := client.JSONGet(ctx, "test-key", "$.a").Result()
Expect(err).NotTo(HaveOccurred())
Expect(val).To(Equal("[1]"))

// Path that doesn't exist
_, err = client.JSONGet(ctx, "test-key", "$.c").Result()
Expect(err).To(Equal(redis.Nil))
})

AfterEach(func() {
// Clean up test keys
client.Del(ctx, "test-key", "non-existent-key")
})
})
}
})

Expand Down
Loading