JSON to JSOn jolt transformation - json

I would like to transform my nested json message and take only required filed using Jolt spec-
My Input JSON :
{
"results": [
{
"user": {
"gender": "male",
"name": {
"title": "mr",
"first": "moritz",
"last": "zimmer"
},
"location": {
"street": "3667 breslauer straße",
"city": "gera",
"state": "mecklenburg-vorpommern",
"zip": 35662
},
"email": "moritz.zimmer#example.com",
"username": "purplegorilla905",
"password": "kkkkk",
"salt": "O5KFiJMB",
"md5": "d5659f39f9102452dca5e9afbfe06f07",
"sha1": "bb8790f5e22a8a4c33f12d623cd7f5c45adba275",
"sha256": "5fc5dd30d75c323404474e2c5bec2372a145f363742162b36a6414aa10e2b5e6",
"registered": 968202500,
"dob": 68248460,
"phone": "0450-7475136",
"cell": "0179-3008357",
"picture": {
"large": "https://randomuser.me/api/portraits/men/15.jpg",
"medium": "https://randomuser.me/api/portraits/med/men/15.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/men/15.jpg"
}
}
},
{
"user": {
"gender": "female",
"name": {
"title": "ms",
"first": "julia",
"last": "bayer"
},
"location": {
"street": "5913 burgstraße",
"city": "mühldorf a. inn",
"state": "bremen",
"zip": 17247
},
"email": "julia.bayer#example.com",
"username": "bluedog987",
"password": "sheba1",
"salt": "qJ3KuIu7",
"md5": "c29e59c439ebc41b6772344b53863a17",
"sha1": "7fdb58f22eb85cb89ffb0c2cbb13bbf3bbb37238",
"sha256": "d6114912b8476e1c825a3487feb1cc7319c0c26f29f583ccd6864fa4f11214db",
"registered": 1224249359,
"dob": 1307176045,
"phone": "0846-0635929",
"cell": "0172-0881456",
"picture": {
"large": "https://randomuser.me/api/portraits/women/15.jpg",
"medium": "https://randomuser.me/api/portraits/med/women/15.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/women/15.jpg"
}
}
},
{
"user": {
"gender": "male",
"name": {
"title": "mr",
"first": "sascha",
"last": "vogel"
},
"location": {
"street": "8276 lerchenweg",
"city": "straubing",
"state": "niedersachsen",
"zip": 73954
},
"email": "sascha.vogel#example.com",
"username": "purplefrog135",
"password": "picard",
"salt": "kBv4gmHR",
"md5": "79a388de1832ab7f14f4e5ddf0d88012",
"sha1": "8fc12f95217bf04eaf7e950154485dd35b84c65e",
"sha256": "a5df2bfd3ee84a869c43f92fe28ce5f56f7700bc75ce2e12bbee7cad2524af82",
"registered": 950549849,
"dob": 310749405,
"phone": "0098-5667969",
"cell": "0179-8473990",
"picture": {
"large": "https://randomuser.me/api/portraits/men/83.jpg",
"medium": "https://randomuser.me/api/portraits/med/men/83.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/men/83.jpg"
}
}
},
{
"user": {
"gender": "female",
"name": {
"title": "mrs",
"first": "luisa",
"last": "döring"
},
"location": {
"street": "9027 am bahnhof",
"city": "salzgitter",
"state": "bayern",
"zip": 12419
},
"email": "luisa.döring#example.com",
"username": "purpleelephant855",
"password": "californ",
"salt": "gsnCNl8c",
"md5": "905d16801137f3368277889a783c02f3",
"sha1": "a5027752e9228bbc1e99fa56a6f2d09a1901e7e2",
"sha256": "51b7e09a415fef7e71eb3aec2721e91d0b51c2e264a7cdd41f3a692777771de3",
"registered": 1068886905,
"dob": 733574914,
"phone": "0648-0740938",
"cell": "0172-1199322",
"picture": {
"large": "https://randomuser.me/api/portraits/women/65.jpg",
"medium": "https://randomuser.me/api/portraits/med/women/65.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/women/65.jpg"
}
}
}
],
"nationality": "DE",
"seed": "23e269027e0ea51404",
"version": "0.8"
}
Expected output :
[
{
"Gender": "male",
"FirstName": "moritz",
"LastName": "zimmer",
"City": "gera",
"State": "mecklenburg-vorpommern",
"Email": "moritz.zimmer#example.com",
"DateOfBirth": 68248460,
"MobileNo": "0179-3008357",
"Nationality": "DE"
},
{
"Gender": "female",
"FirstName": "julia",
"LastName": "bayer",
"City": "mühldorf a. inn",
"State": "bremen",
"Email": "julia.bayer#example.com",
"DateOfBirth": 1307176045,
"MobileNo": "0172-0881456",
"Nationality": "DE"
},
{
"Gender": "male",
"FirstName": "sascha",
"LastName": "vogel",
"City": "straubing",
"State": "niedersachsen",
"Email": "sascha.vogel#example.com",
"DateOfBirth": 310749405,
"MobileNo": "0179-8473990",
"Nationality": "DE"
},
{
"Gender": "female",
"FirstName": "luisa",
"LastName": "döring",
"City": "salzgitter",
"State": "bayern",
"Email": "luisa.döring#example.com",
"DateOfBirth": 733574914,
"MobileNo": "0172-1199322",
"Nationality": "DE"
}
]
I am using below Spec and output not coming as per expectation -
My Spec :
[
{
"operation": "shift",
"spec": {
"results": {
"*": {
"user": {
"gender": "[&2].Gender",
"name": {
"first": "[&3].FirstName",
"last": "[&3].LastName"
},
"location": {
"city": "[&3].City",
"state": "[&3].State"
},
"email": "[&2].Email",
"dob": "[&2].DateOfBirth",
"cell": "[&2].MobileNo"
}
}
}
}
}
]
Below my Spec output which is not as expected -
[
{
"Gender": "male",
"FirstName": "moritz",
"LastName": "zimmer",
"City": "gera",
"State": "mecklenburg-vorpommern",
"Email": "moritz.zimmer#example.com",
"DateOfBirth": 68248460,
"MobileNo": "0179-3008357"
},
{
"Gender": "female",
"FirstName": "julia",
"LastName": "bayer",
"City": "mühldorf a. inn",
"State": "bremen",
"Email": "julia.bayer#example.com",
"DateOfBirth": 1307176045,
"MobileNo": "0172-0881456"
},
{
"Gender": "male",
"FirstName": "sascha",
"LastName": "vogel",
"City": "straubing",
"State": "niedersachsen",
"Email": "sascha.vogel#example.com",
"DateOfBirth": 310749405,
"MobileNo": "0179-8473990"
},
{
"Gender": "female",
"FirstName": "luisa",
"LastName": "döring",
"City": "salzgitter",
"State": "bayern",
"Email": "luisa.döring#example.com",
"DateOfBirth": 733574914,
"MobileNo": "0172-1199322"
}
]
I tried many option but nationality is not coming inside as my expected output.
Please help here in Jolt transformation

Tip : Looking at outer part of the results array by using "*": "&" while looking at the inner part of that, and combining them under name key which seems to be unique as a grouping by criteria for the desired result set such as
[
{
"operation": "shift",
"spec": {
"results": {
"*": {
"user": {
"*": "&"
}
}
},
"*": "&"
}
},
{
"operation": "shift",
"spec": {
"name": {
"*": {
"#(2,gender[&])": "[&].Gender",
"#(0,first)": "[&1].First&2",
"#(0,last)": "[&1].Last&2",
"#(2,location[&].city)": "[&].City",
"#(2,location[&].state)": "[&].State",
"#(2,email[&])": "[&].Email",
"#(2,dob[&])": "[&].DateOfBirth",
"#(2,phone[&])": "[&].MobileNo",
"#(2,nationality)": "[&].Nationality"
}
}
}
}
]

Related

I need to retrieve the index(number 1) information in mongodb compass

I just need to query all information of the doctor in the first index.
Here is my sample XML data
Here is my sample JSON data:
Both XML and JSON data are same. I just converted the XML to JSON format.
I have more documents like this.
I tried this query in this image
this query showing all information but I just need first doctors information.
I also tried in command prompt.Here is the query done in cmd
Here is my sample JSON code block: but I have more similar documents
{
"doctors": {
"doctor":[
{
"ssn": "257-79-xxxx",
"name": "Mavis Bxx",
"address": "xxxx Rusk Drive",
"country": "France",
"email": "",
"phone": "",
"patients": {
"patient": [
{
"gender": "Male",
"name": "Itch xxxx",
"address": "xx Cottonwood Avenue",
"revenue": "254",
"_country": "Spain",
"_id": "27"
},
{
"gender": "Male",
"name": "Damon xxxxx",
"address": "xx David Trail",
"revenue": "370",
"_country": "Germany",
"_id": "21"
}
]
},
"_id": "6"
},
{
"ssn": "179-45-xxxx",
"name": "Tobie Conxxxx",
"address": "x Comanche Center",
"country": "Spain",
"email": "tconringh#xxx.xxx",
"phone": "+86 998 262 xxxx",
"patients": {
"patient": {
"gender": "Male",
"name": "Vergil Tome",
"address": "x Melody Drive",
"revenue": "254",
"_country": "Germany",
"_id": "15"
}
},
"_id": "18"
},
{
"ssn": "777-59-xxxx",
"name": "Gertrud Macxxxx",
"address": "x Buell Drive",
"country": "USA",
"email": "gmaclaig2#xxx.com",
"phone": "+62 975 394 xxxx",
"patients": {
"patient": [
{
"gender": "Non-binary",
"name": "Dre Skxxxx",
"address": "x Becker Circle",
"revenue": "400",
"_country": "Germany",
"_id": "20"
},
{
"gender": "Female",
"name": "Arleyne Lestxxxx",
"address": "xx Farragut Court",
"revenue": "225",
"_country": "France",
"_id": "22"
}
]
},
"_id": "3"
}
You needs to change your collect data format. Your current format is single big size data. Not a quarriable format.
So
From current format
{
"doctors": {
"docker": [
{
...
"patients": {
"patient": [
{
...
},
{
...
}
]
},
},
{
...
}
]
}
}
To this format
[
{
...
"patients": [
{
...
},
{
...
}
]
},
{
...
}
]
Test JSON
[
{
"ssn": "2xx-7x-4xxx",
"name": "Mavis Bxxxed",
"address": "9xxx Rusk Drive",
"country": "France",
"email": "",
"phone": "",
"patients": [
{
"gender": "Male",
"name": "Itch Txxx",
"address": "5xx Cottonwood Avenue",
"revenue": "25x",
"_country": "Spain",
"_id": "27"
},
{
"gender": "Male",
"name": "Damon Wxxx",
"address": "09xx Dxxxx Trail",
"revenue": "370",
"_country": "Germany",
"_id": "21"
}
],
"_id": "6"
},
{
"ssn": "19-45-xxxx",
"name": "Tobie Coxxxx",
"address": "8x Comxxxx Center",
"country": "Spain",
"email": "tconxxxxx#usa.gov",
"phone": "",
"patients": [
{
"gender": "Male",
"name": "Some one",
"address": "1 Mexxxx Drive",
"revenue": "254",
"_country": "Germany",
"_id": "15"
}
],
"_id": "18"
}
]
In Compass View after add data upper data
Find doctor by name query
{ name: "Mavis Bxxxed" }
Find doctor by patient name
{ "patients.name": "Some one" }
If same search with this query
{ "patients.name": "Itch Txxx" }
OR
{ "patients.name": "Damon Wxxx" }
will same result to find the first docker (Mavis Bxxxed)
Due to it's patients start [ and end ]. it is array type a single size of data.
You can filter by project option
{
patients: {
$filter:
{
input: "$patients",
cond: { $eq: [ "$$patient.name", "Itch Txxx"] },
as: "patient"
}
}
}
OR shows only address
{ "patients.address" : 1 }

Metafield is returning an error of "value":"expected Hash to be a String" when the metafield type is JSON

I'm using the Shopify customer API to create customers. It all works well until I add a metafield of type JSON. Then, I get the response {"errors":{"value":"expected Hash to be a String"}}.
Here is the entire object I'm submitting:
{
"customer": {
"accepts_marketing": "true",
"accepts_marketing_updated_at": "2022-03-01T12:45:42.770",
"currency": "USD",
"default_address": {
"zip": "91321",
"city": "SomeCity",
"phone": "5555551111",
"customerCompany": "",
"countryCode": "US",
"default": "true",
"address1": "1111 My Street",
"address2": "",
"province_code": "CA",
"last_name": "LastusNamus",
"first_name": "FirstusNamus"
},
"email": "myemail#yahoo.com",
"first_name": "FirstusNamus",
"last_name": "LastusNamus",
"created_at": "2011-12-07T00:00:00",
"marketing_opt_in_level": "single_opt_in",
"note": "",
"order_count": 0,
"phone": "5555551111",
"state": "enabled",
"tax_exempt": "false",
"verfified_email": "true",
"metafields": [{
"namespace": "customer",
"key": "kickeeinfo",
"type": "json",
"value": {
"idcustomer": "37",
"iRewardPointsAccrued": "3000",
"iRewardPointsUsed": "0",
"idCustomerCategory": "0"
}
}]
}
}
Here is the string actually being submitted:
{"customer":{"accepts_marketing":"true","accepts_marketing_updated_at":"2022-03-01T12:45:42.770","currency":"USD","default_address":{"zip":"91321","city":"SomeCity","phone":"5555551111","customerCompany":"","countryCode":"US","default":"true","address1":"1111 My Street","address2":"","province_code":"CA","last_name":"LastusNamus","first_name":"FirstusNamus"},"email":"myemail#yahoo.com","first_name":"FirstusNamus","last_name":"LastusNamus","created_at":"2011-12-07T00:00:00","marketing_opt_in_level":"single_opt_in","note":"","order_count":0,"phone":"5555551111","state":"enabled","tax_exempt":"false","verfified_email":"true","metafields":[{"namespace":"customer","key":"kickeeinfo","type":"json","value":{"idcustomer":"37","iRewardPointsAccrued":"3000","iRewardPointsUsed":"0","idCustomerCategory":"0"}}]}}
What is the API expecting to be submitted? I've tried escaping the metafield "value" object and that doesn't work. I get an "unexpected token" error at that point.
The metafield value has to be escaped and then enclosed in quotes:
{
"customer": {
"accepts_marketing": "true",
"accepts_marketing_updated_at": "2022-03-01T12:45:42.770",
"currency": "USD",
"default_address": {
"zip": "91321",
"city": "SomeCity",
"phone": "5555551111",
"customerCompany": "",
"countryCode": "US",
"default": "true",
"address1": "1111 My Street",
"address2": "",
"province_code": "CA",
"last_name": "LastusNamus",
"first_name": "FirstusNamus"
},
"email": "myemail#yahoo.com",
"first_name": "FirstusNamus",
"last_name": "LastusNamus",
"created_at": "2011-12-07T00:00:00",
"marketing_opt_in_level": "single_opt_in",
"note": "",
"order_count": 0,
"phone": "5555551111",
"state": "enabled",
"tax_exempt": "false",
"verfified_email": "true",
"metafields": [{
"namespace": "customer",
"key": "kickeeinfo",
"type": "json",
"value": "{\"idcustomer\": \"37\",\"iRewardPointsAccrued\": \"3000\",\"iRewardPointsUsed\": \"0\",\"idCustomerCategory\": \"0\"}"
}]
}
}

Angular http request how to convert Json Object into an object Array

i wanted to simulate a http request by reading an Json File and its stored data. Here is how i tryed it
Data.json:
{ "jsonData": {
"data1": [{
"age": "18",
"name": "bernd",
"gender": "1"
}],
"data2": [{ "age": "18", "name": "bernd", "gender": "1"},
{ "age": "18", "name": "bernd", "gender": "1"},
{ "age": "15", "name": "bernd", "gender": "1"},
{ "age": "18", "name": "marting", "gender": "1"},
{ "age": "25", "name": "bernd", "gender": "1"},
{ "age": "29", "name": "bernd", "gender": "1"},
{ "age": "18", "name": "mike", "gender": "1"},
{ "age": "45", "name": "bernd", "gender": "1"},
{ "age": "18", "name": "bernd", "gender": "1"}
],
"data3": [{ "age": "18", "name": "mike", "gender": "1"},
{ "age": "18", "name": "monika", "gender": "2"},
{ "age": "18", "name": "martin", "gender": "1"},
{ "age": "18", "name": "monika", "gender": "2"},
{ "age": "18", "name": "monika", "gender": "2"},
{ "age": "18", "name": "monika", "gender": "2"},
{ "age": "18", "name": "bernd", "gender": "1"},
{ "age": "18", "name": "bernd", "gender": "1"},
{ "age": "18", "name": "lisa", "gender": "2"}
]}}
and a service which recieves the data
data.service:
getServers() {
return this.http.get('../assets/Data.json')
.subscribe((res: Response) => {
this.testData = res.json().data2;
} );}
The plan is to get for example the "data2" object Array into "this.testData". I tryed different versions of http.get, but just managed to get the Json object without successfully converting it into a object[].
I would really appreciate your help guys.

how to extract values from a JSON file? Is regex a solution?

I have a file that's quite large with entries that look like this:
{
"_id": {
"$oid": "572a5b93ae5174d3c4177da3"
},
"email": "removed#gmail.com",
"gender": "F",
"zip": "32934",
"state": "FL",
"city": "EAU GALLIE",
"address1": "removed",
"last_name": "removed",
"first_name": "removed",
"updatedAt": {
"$date": "2016-05-04T20:29:02.061Z"
},
"__v": 0,
"createdAt": {
"$date": "2016-05-04T20:28:54.948Z"
}
}
{
"_id": {
"$oid": "57a49bed913aebc7257145b9"
},
"email": "removed#gmail.com",
"dob": "11/06/1996",
"gender": "F",
"zip": "SN14 8BZ",
"address1": "removed",
"last_name": "removed",
"first_name": "removed",
"updatedAt": {
"$date": "2016-08-16T23:53:30.161Z"
},
"__v": 0,
"createdAt": {
"$date": "2016-08-05T14:00:13.130Z"
}
}
{
"_id": {
"$oid": "57a49bed913aebc7257145d3"
},
"email": "removed#netzero.net",
"zip": "NULL",
"state": "NULL",
"city": "NULL",
"address1": "NULL",
"last_name": "removed",
"first_name": "removed",
"updatedAt": {
"$date": "2016-08-05T14:00:13.467Z"
},
"__v": 0,
"createdAt": {
"$date": "2016-08-05T14:00:13.467Z"
}
}
{
"_id": {
"$oid": "57ab71379f7474b50eef976d"
},
"updatedAt": {
"$date": "2016-08-16T23:40:55.851Z"
},
"createdAt": {
"$date": "2016-08-10T18:23:51.177Z"
},
"email": "removed#hotmail.co.uk",
"ip": "0.0.0.0",
"first_name": "removed",
"last_name": "removed",
"address1": "removed",
"city": "",
"state": "",
"zip": "removed",
"gender": "F",
"__v": 0,
"dob": "03/01/1973"
}
{
"_id": {
"$oid": "57ab7137913aebc725194a20"
},
"email": "removed#gmail.com",
"job": "DeliveryDriver",
"zip": "24401",
"state": "VA",
"city": "FISHERSVILLE",
"updatedAt": {
"$date": "2016-09-16T12:45:50.984Z"
},
"__v": 0,
"createdAt": {
"$date": "2016-08-10T18:23:50.813Z"
},
"gender": "M",
"last_name": "removed",
"first_name": "removed"
}
and it's not in a particular order, i obviously removed names, address,ip's, and emails for privacy concerns. But the lines are all over, more than 20M of them.
How can i parse this properly? I'm looking to only extract Email, IP, Phone number, Name (First and Last) and Address (Zip, Address1,Addres2, City)
Some of these lines only have email & IP, and some have Email, IP, name, and some have Email, Name, Address and so on, including some with all the lines (they all have some junk data like OID, created and updated date, gender, ect)
What would the best way parsing this? I've been trying for a while now and i know it's been done, Thank you!
Don't try to parse json with regex, instead, try jq.
It's cross-platforms.
Example, adapt the command to your needs :
$ jq '(.email, .first_name, .last_name)' file.json
Output:
"removed#gmail.com"
"removed"
"removed"
"removed#gmail.com"
"removed"
"removed"
"removed#netzero.net"
"removed"
"removed"
"removed#hotmail.co.uk"
"removed"
"removed"
"removed#gmail.com"
"removed"
"removed"
Check https://stedolan.github.io/jq/
Or you can use nodejs and js code

Mule flow only processing 1 record from csv file

I have a mule flow which goes FILE -> CHOICE -> DATAMAPPER -> LOGGER
The FILE endpoint processes a csv file with 40 records
The DATAMAPPER converts the csv into JSON and shows all 40 records in JSON format when run in preview
The LOGGER shows that the payload as a byte and not JSON and when I convert JSON to object it shows the payload in JSON format but there is only 1 record.
My queries:
1. How do you setup the workflow to process all of the 40 records and convert all to JSON and output all from the flow?
Is it correct that the output is a byte because the datamapper output is JSON so I was expecting to see all records in JSON format in the payload when looking at it in debug mode?
You can do something like this.
<flow name="csv-to-jsonFlow">
<file:inbound-endpoint path="/src/main/resources/csv" connector-ref="File" responseTimeout="10000" doc:name="File">
<file:filename-regex-filter pattern=".*csv" caseSensitive="true"/>
</file:inbound-endpoint>
<dw:transform-message doc:name="Transform Message">
<dw:set-payload><![CDATA[%dw 1.0
%output application/json
---
payload]]></dw:set-payload>
</dw:transform-message>
<object-to-string-transformer doc:name="Object to String"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
Sample CSV file:
name,age,gender
janos,29,male
juan,40,male
pedro,22,male
carla,34,female
jose,30,male
anne,25,female
rey,33,male
joyce,27,female
pia,20,female
ard,27,male
janos,29,male
juan,40,male
pedro,22,male
carla,34,female
jose,30,male
anne,25,female
rey,33,male
joyce,27,female
pia,20,female
ard,27,male
janos,29,male
juan,40,male
pedro,22,male
carla,34,female
jose,30,male
anne,25,female
rey,33,male
joyce,27,female
pia,20,female
ard,27,male
janos,29,male
juan,40,male
pedro,22,male
carla,34,female
jose,30,male
anne,25,female
rey,33,male
joyce,27,female
pia,20,female
ard,27,male
Sample Output:
[
{
"name": "janos",
"age": "29",
"gender": "male"
},
{
"name": "juan",
"age": "40",
"gender": "male"
},
{
"name": "pedro",
"age": "22",
"gender": "male"
},
{
"name": "carla",
"age": "34",
"gender": "female"
},
{
"name": "jose",
"age": "30",
"gender": "male"
},
{
"name": "anne",
"age": "25",
"gender": "female"
},
{
"name": "rey",
"age": "33",
"gender": "male"
},
{
"name": "joyce",
"age": "27",
"gender": "female"
},
{
"name": "pia",
"age": "20",
"gender": "female"
},
{
"name": "ard",
"age": "27",
"gender": "male"
},
{
"name": "janos",
"age": "29",
"gender": "male"
},
{
"name": "juan",
"age": "40",
"gender": "male"
},
{
"name": "pedro",
"age": "22",
"gender": "male"
},
{
"name": "carla",
"age": "34",
"gender": "female"
},
{
"name": "jose",
"age": "30",
"gender": "male"
},
{
"name": "anne",
"age": "25",
"gender": "female"
},
{
"name": "rey",
"age": "33",
"gender": "male"
},
{
"name": "joyce",
"age": "27",
"gender": "female"
},
{
"name": "pia",
"age": "20",
"gender": "female"
},
{
"name": "ard",
"age": "27",
"gender": "male"
},
{
"name": "janos",
"age": "29",
"gender": "male"
},
{
"name": "juan",
"age": "40",
"gender": "male"
},
{
"name": "pedro",
"age": "22",
"gender": "male"
},
{
"name": "carla",
"age": "34",
"gender": "female"
},
{
"name": "jose",
"age": "30",
"gender": "male"
},
{
"name": "anne",
"age": "25",
"gender": "female"
},
{
"name": "rey",
"age": "33",
"gender": "male"
},
{
"name": "joyce",
"age": "27",
"gender": "female"
},
{
"name": "pia",
"age": "20",
"gender": "female"
},
{
"name": "ard",
"age": "27",
"gender": "male"
},
{
"name": "janos",
"age": "29",
"gender": "male"
},
{
"name": "juan",
"age": "40",
"gender": "male"
},
{
"name": "pedro",
"age": "22",
"gender": "male"
},
{
"name": "carla",
"age": "34",
"gender": "female"
},
{
"name": "jose",
"age": "30",
"gender": "male"
},
{
"name": "anne",
"age": "25",
"gender": "female"
},
{
"name": "rey",
"age": "33",
"gender": "male"
},
{
"name": "joyce",
"age": "27",
"gender": "female"
},
{
"name": "pia",
"age": "20",
"gender": "female"
},
{
"name": "ard",
"age": "27",
"gender": "male"
}
]
Hope this helps.