How can query a Doc Docs via N1QL and return data from an Array of Objects. So i am wondering if i can do this in N1Ql directly or if i have to get the whole data and transform the data in nodeJS. Here is what a sample of Data looks like’
{
"Name": "Tom Miller",
"id": "191e13ba-9ac8-4eb5-aa6b-28f56357aca3",
"phones": [
{
"guid": "0f8f5ee7-368a-4632-a58e-4581fc0a7912",
"number": "2135551212",
"type": "mobile"
},
{
"guid": "752c82a3-6ac0-49ac-ad17-1e6336cb30d6",
"number": "2135554412",
"type": "home"
},
{
"guid": "73d016c7-2cb3-42b4-bf2a-c6cbc33b62b3",
"number": "2135555512",
"type": "work"
},
{
"guid": "6f5debed-7db6-4466-b484-25944993bd7f",
"number": "2135556644",
"type": "fax"
}
]
}
And this is what i am looking for as far as the output
{
"Name": "Tom Miller",
"id": "191e13ba-9ac8-4eb5-aa6b-28f56357aca3",
"mobile": "2135551212",
"work": "2135555512"
}