Skip to content

Unable to select numbers #51

Open
Open
@AurelioDeRosa

Description

@AurelioDeRosa

Hi. The file shown below is a valid JSON object. However, unless I wrap numbers with the double quote, JSONSelect isn't able to select an object.

So, using this file:

{
   "categories": [
      {
         "id": "1",
        "name": "Test"
      },
      {
         "id": 2,
         "name": "Boom"
      }
  ]
}

If I write

JSONSelect.match('.categories :has(.id:val("1"))', data);

it find the object. If I write

JSONSelect.match('.categories :has(.id:val("2"))', data);

it doesn't find the object (an empty array is returned).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions