0

I have a json string as shown in the example below, and I need to extract from it the Full Name of the members.

I know I can extract each of them separately with

 $.members[*].lastName   and    $.members[*].firstName

but I can't seem to figure out how to get both of them together in one JSON query. i read about using the "," as a means but I couldn't figure out how for my specific case.

{
"group": "BLUE",
  "members": [
    {
       "memberId": "00081",
       "firstName": "JOHN",
       "lastName": "SMITH",
       "mail": "JSMITH@EXAMPLE.com"
    } ,
    {
       "memberId": "00081",
       "firstName": "JANE",
       "lastName": "DOE",
       "mail": "JDOE@EXAMPLE.com"
    }
  ]
}

Expected result: [ John Smith, John Doe]

Any help or guidance would be greatly appreciated, I've never used JSON queries before.

HelpWanted
  • 71
  • 1
  • 9

1 Answers1

0

I figured it out with over 10 hrs of attempts and research:

"$.members[*].['firstName','lastName']"

I did not know I had to use the '' . Hope this helps someone else.

HelpWanted
  • 71
  • 1
  • 9