FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Setting a value whose path is not yet in the object does not work if the JSONPath contains [*] · Issue #1306 · RedisJSON/RedisJSON · GitHub

Repository navigation

Setting a value whose path is not yet in the object does not work if the JSONPath contains [*] #1306

Description

Setting a value whose path does not yet exist in the object (but its parent does exist) should work, but it doesn't if there is a [*] in the JSON path.

Description

valkey-server:6379> JSON.SET mydoc $ '{"list": [{}]}'
OK
valkey-server:6379> JSON.SET mydoc $.list[*].fruit '"apple"'
(error) Err wrong static path

This behavior is inconsistent with what happens when the path already exists, which works:

valkey-server:6379> JSON.SET mydoc $ '{"list": [{"fruit": "pear"}]}'
OK
valkey-server:6379> JSON.SET mydoc $.list[*].fruit '"apple"'
OK

It also works if the [*] is replaced with [0]:

valkey-server:6379> JSON.SET mydoc $ '{"list": [{}]}'
OK
valkey-server:6379> JSON.SET mydoc $.list[*].fruit '"apple"'
(error) Err wrong static path

Installation details

OS: Arch linux, Kernel
Redis version: Valkey 7.2 (from DockerHub)
Architecture: x86-64
RedisJSON version: 2.8.4

Activity

  1. LiorKogan commented on Dec 19, 2024

    Contributor

    Duplicate? #788

  2. nnmm commented on Dec 20, 2024

    Author

    Duplicate? #788

    Yes, seems to be the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL