Skip to content

Path processing filter is inconsistent for numeric data #596

@dushyantbangal

Description

@dushyantbangal

When we try to use the Path processing Filter [] on numeric values, it is inconsistent compared to text values.

Consider the following input:

[
  {
    "txt":"one",
    "num":1
  },
  {
    "txt":"two",
    "num":2
  },
  {
    "txt":"three",
    "num":3
  },
  {
    "num":4
  },
  {
    "txt":"five"
  }
]

Inconsistencies:

  1. $[num] does not return anything, but $[txt] returns all the objects in which txt has any value.
    image

  2. In the input, if you change the value in Object 4 from "num":4 to "num":3, then $[num] starts working but only returns that one object even when others have value and we are not specifically filtering for num=3

    • This is happening when theres duplicate values one after another. When both Object 1 and 2 have "num":1, it returns the second object.
    • When Object 3 and 5 have save value for num, it they dont get included.
      image

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