Skip to content

Commit

Permalink
linkfixes + build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sashpawar11 committed Oct 20, 2024
1 parent b353d75 commit e7d1433
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/eval/store_eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ func evalJSONOBJLEN(args []string, store *dstore.Store) *EvalResponse {
if isDefinitePath {
return &EvalResponse{
Result: nil,
Error: diceerrors.ErrWrongTypeOperation,
Error: diceerrors.ErrWrongTypeOperation,
}
}
objectLen = append(objectLen, nil)
Expand Down
8 changes: 4 additions & 4 deletions internal/server/utils/json.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package utils

// This method returns the path, and a boolean value telling if the path provided follows Legacy Path Syntax or JSONPath syntax.
// JSON knows which syntax to use depending on the first character of the path query.
// This method returns the path, and a boolean value telling if the path provided follows Legacy Path Syntax or JSONPath syntax.
// JSON knows which syntax to use depending on the first character of the path query.
// If the query starts with the character $, it uses JSONPath syntax. Otherwise, it defaults to the legacy path syntax.
// A JSONPath query can resolve to several locations in a JSON document.
// A JSONPath query can resolve to several locations in a JSON document.
// In this case, the JSON commands apply the operation to every possible location. This is a major improvement over legacy path queries, which only operate on the first path.
func ParseInputJSONPath(path string) (string, bool) {
isLegacyPath := path[0] != '$'

// Handle . path error
if len(path) ==1 && path[0] == '.' {
if len(path) == 1 && path[0] == '.' {
path = "$"
}
return path, isLegacyPath
Expand Down
2 changes: 1 addition & 1 deletion internal/worker/cmd_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const (
CmdJSONObjlen = "JSON.OBJLEN"
CmdZAdd = "ZADD"
CmdZRange = "ZRANGE"
CmdZRank = "ZRANK"
CmdZRank = "ZRANK"
CmdPFAdd = "PFADD"
CmdPFCount = "PFCOUNT"
CmdPFMerge = "PFMERGE"
Expand Down

0 comments on commit e7d1433

Please sign in to comment.