diff --git a/core/redison_handler.go b/core/redison_handler.go index 996f450..65fa931 100644 --- a/core/redison_handler.go +++ b/core/redison_handler.go @@ -65,7 +65,7 @@ func (rh *RedisonHandler) JSONMSet(key string, kv map[string]any) error { if err != nil { return err } - pl.Do(rh.ctx, "JSON.SET", key, path, b) + pl.Do(rh.ctx, "JSON.SET", key, path, fmt.Sprintf("'%s'", string(b))) } cmders, err := pl.Exec(rh.ctx) @@ -91,7 +91,7 @@ func (rh *RedisonHandler) JSONSet(key, path string, obj any, opts ...SetOption) "JSON.SET", key, path, - b, + fmt.Sprintf("'%s'", string(b)), } if len(opts) > 0 { args = append(args, opts[0]) @@ -266,7 +266,7 @@ func appendValues(args []any, values ...any) []any { args = append(args, jsonValue) default: bt, _ := json.Marshal(jsonValue) - args = append(args, bt) + args = append(args, fmt.Sprintf("'%s'", string(bt))) } } return args