Skip to content

Return as object with key and value of match. #153

Open
@dionsnoeijen

Description

@dionsnoeijen

With this json:

{
  "firstName": "John",
  "lastName" : "doe",
  "age"      : 26,
  "address"  : {
    "streetAddress": "naist street",
    "city"         : "Nara",
    "postalCode"   : "630-0192"
  },
  "phoneNumbers": [
    {
      "type"  : "iPhone",
      "number": "0123-4567-8888",
      "other" : "value"
    },
    {
      "type"  : "home",
      "number": "0123-4567-8910",
      "other" : "value"
    }
  ]
}

A query like this: $.phoneNumbers.[type,number] returns:

[
  "iPhone",
  "0123-4567-8888",
  "home",
  "0123-4567-8910"
]

It would be very helpful if there is an option to make the result as this:

[
    {"type": "IPhone", "number": "0123-4567-8888"},
    {"type": "home", "number": "0123-4567-8910"}
]

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