Thanks to visit codestin.com
Credit goes to github.com

Skip to content

JSON.DEL deletes only the first 10 matches #1374

@LiorKogan

Description

@LiorKogan

For object members:

> JSON.SET j $ '[{"x":1},{"x":2},{"x":3},{"x":4},{"x":5},{"x":6},{"x":7},{"x":8},{"x":9},{"x":10},{"x":11},{"x":12}]' 
OK
> JSON.DEL j '$[?(@.x>0)]'
(integer) 10
> JSON.GET j 
"[{\"x\":11},{\"x\":12}]"

For array elements:

> JSON.SET k $ '[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]'
OK
> JSON.DEL k '$[?(@>0)]'
(integer) 10
> JSON.GET k
"[11,12,13,14,15]"

Reported in https://stackoverflow.com/questions/79725743

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions