Skip to content

Allow JSON.ARRINDEX with none scalar values #892

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

Merged
merged 6 commits into from
Dec 20, 2022

Conversation

gkorland
Copy link
Contributor

@gkorland gkorland commented Dec 19, 2022

fix #886

127.0.0.1:6379> json.set a $ '{"a":[[1, 2], [2,3]], "b":[[2,4], [1,2]]}'
OK
127.0.0.1:6379> JSON.ARRINDEX a $.* '[1,2]'
1) (integer) 0
2) (integer) 1


127.0.0.1:6379> json.set a $ '{"a":[{"b":1}, {"c":2}], "b":[{"b":1}, {"c":2}]}'
OK
127.0.0.1:6379> JSON.ARRINDEX a $.* '{"c":2}'
1) (integer) 1
2) (integer) 1

@gkorland gkorland requested a review from oshadmi December 19, 2022 13:15
@codecov
Copy link

codecov bot commented Dec 19, 2022

Codecov Report

Base: 81.41% // Head: 81.40% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (7a3e7b6) compared to base (f43dfb8).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #892      +/-   ##
==========================================
- Coverage   81.41%   81.40%   -0.01%     
==========================================
  Files          14       14              
  Lines        3879     3872       -7     
==========================================
- Hits         3158     3152       -6     
+ Misses        721      720       -1     
Impacted Files Coverage Δ
src/commands.rs 95.68% <100.00%> (+0.04%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gkorland gkorland merged commit 6ff8be9 into master Dec 20, 2022
@gkorland gkorland deleted the gkorland-arrindex-none-scalar branch December 20, 2022 11:42
rafie pushed a commit that referenced this pull request Dec 27, 2022
* add support for arrindex for none scalars

* test no scalar on arrindex

* clean code rename args

* fix tests

* fix tests

(cherry picked from commit 6ff8be9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for composite value in JSON.ARRINDEX
2 participants