Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2e48080
Multi path: del - add test and doc
oshadmi Oct 17, 2021
e77daf1
WIP [skip ci] Multi path: get multi value and multi path
oshadmi Oct 17, 2021
13b69fb
Multi path: fix multi value/path (not yet resp array)
oshadmi Oct 18, 2021
6b2ce78
Multi path: mget multi value/path and test fixes
oshadmi Oct 19, 2021
a1fbcb3
Multi path: numincrby nummultby numpowby
oshadmi Oct 20, 2021
378b050
Multi path: get fails with legacy path
oshadmi Oct 20, 2021
8aeb435
Multi path: Try using jsonpath lib api select_values_with_paths
oshadmi Oct 20, 2021
0b6dedb
Multi path: Workaround without jsonpath lib api select_values_with_paths
oshadmi Oct 20, 2021
e7c8439
Multi path: strappend strlen
oshadmi Oct 22, 2021
8a6e55c
Multi path: arrappend
oshadmi Oct 23, 2021
a4ad038
Multi path: arrinsert
oshadmi Oct 23, 2021
850a738
Multi path: arrlen
oshadmi Oct 23, 2021
5f3d408
Multi path: arrpop
oshadmi Oct 24, 2021
3faec15
Multi path: arrtrim
oshadmi Oct 24, 2021
331079b
Multi path: avoid crash in arrtrim (fix ArrayIndex normalize)
oshadmi Oct 24, 2021
793c0f5
Multi path: objkeys
oshadmi Oct 25, 2021
0db42d4
Multi path: objlen and type commands
oshadmi Oct 26, 2021
787fc56
Multi path: toggle command
oshadmi Oct 26, 2021
bd4d2a7
Multi path: debug memory commands
oshadmi Oct 26, 2021
80192da
Multi path: debug memory fix test
oshadmi Oct 26, 2021
8e0e119
Multi path: json.type without get_type_name api
oshadmi Oct 26, 2021
e9e4cb4
Multi path: json.resp
oshadmi Oct 26, 2021
30304ad
Multi path: temporarily build macos *on-any-branch
oshadmi Oct 26, 2021
beed0ea
Multi path: restore legacy backward compatibility for numXby strlen s…
oshadmi Oct 26, 2021
11459b5
Merge remote-tracking branch 'origin/master' into omer_multipath_1
oshadmi Oct 26, 2021
90c0bfb
Multipath - merge from temp PR #487
oshadmi Oct 28, 2021
8ac04ef
Merge remote-tracking branch 'origin/master' into omer_multipath_1
oshadmi Oct 28, 2021
c0e120b
Merge remote-tracking branch 'origin/master' into omer_multipath_1
oshadmi Oct 28, 2021
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ workflows:
parameters:
platform: [focal, bionic, xenial, centos8, centos7, bullseye]
- build-macos:
<<: *on-integ-and-version-tags
<<: *on-integ-and-version-tags
- deploy-artifacts:
name: deploy_snapshot
location: snapshots
Expand Down
66 changes: 33 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ Pretty-formatted JSON is producible with `redis-cli` by following this example:

#### Return value

[Bulk String][3], specifically the JSON serialization.

The reply's structure depends on the number of paths. A single path results in the value itself being returned, whereas multiple paths are returned as a JSON object in which each path is a key.
[Array][4] of [Bulk Strings][3], specifically, each string is the JSON serialization of each JSON value matching a path.

### JSON.MGET

Expand Down Expand Up @@ -135,7 +133,7 @@ Delete a value.

#### Return value

[Integer][2], specifically the number of paths deleted (0 or 1).
[Integer][2], specifically the number of paths deleted (0 or more).

### JSON.NUMINCRBY

Expand Down
9 changes: 8 additions & 1 deletion src/array_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ impl ArrayIndex for i64 {
let index = if self < 0 {
len - len.min(-self)
} else {
(len - 1).min(self)
if len > 0 {
(len - 1).min(self)
} else {
0
}
};
index as usize
}
Expand All @@ -29,5 +33,8 @@ mod tests {
assert_eq!(4.normalize(5), 4);
assert_eq!(5.normalize(5), 4);
assert_eq!(6.normalize(5), 4);
assert_eq!(0.normalize(0), 0);
assert_eq!((-1).normalize(0), 0);
assert_eq!(1.normalize(0), 0);
}
}
Loading