Skip to content

Commit 56bcaaa

Browse files
committed
Support ReJSON resp 2 && Test ReJSON against RESP 2 and 3 && Add complex search and json test
1 parent 9e3709c commit 56bcaaa

File tree

3 files changed

+787
-628
lines changed

3 files changed

+787
-628
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ require (
77
github.com/bsm/gomega v1.27.10
88
github.com/cespare/xxhash/v2 v2.2.0
99
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
10+
github.com/go-redis/redis/v8 v8.11.5
1011
)
1112

1213
retract (
13-
v9.5.3 // This version was accidentally released. Please use version 9.6.0 instead.
1414
v9.5.4 // This version was accidentally released. Please use version 9.6.0 instead.
15+
v9.5.3 // This version was accidentally released. Please use version 9.6.0 instead.
1516
)

json.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type JSONArrTrimArgs struct {
6060
type JSONCmd struct {
6161
baseCmd
6262
val string
63-
expanded []interface{}
63+
expanded interface{}
6464
}
6565

6666
var _ Cmder = (*JSONCmd)(nil)
@@ -100,11 +100,11 @@ func (cmd *JSONCmd) Result() (string, error) {
100100
return cmd.Val(), cmd.Err()
101101
}
102102

103-
func (cmd JSONCmd) Expanded() (interface{}, error) {
103+
func (cmd *JSONCmd) Expanded() (interface{}, error) {
104104
if len(cmd.val) != 0 && cmd.expanded == nil {
105105
err := json.Unmarshal([]byte(cmd.val), &cmd.expanded)
106106
if err != nil {
107-
return "", err
107+
return nil, err
108108
}
109109
}
110110

@@ -494,7 +494,7 @@ func (c cmdable) JSONMSet(ctx context.Context, params ...interface{}) *StatusCmd
494494
}
495495

496496
// JSONNumIncrBy increments the number value stored at the specified path by the provided number.
497-
// For more information, see https://redis.io/commands/json.numincreby
497+
// For more information, see https://redis.io/docs/latest/commands/json.numincrby/
498498
func (c cmdable) JSONNumIncrBy(ctx context.Context, key, path string, value float64) *JSONCmd {
499499
args := []interface{}{"JSON.NUMINCRBY", key, path, value}
500500
cmd := newJSONCmd(ctx, args...)

0 commit comments

Comments
 (0)