How can i change output Format in N1QL


#1

My Query looks like this

select  c._id,a.full_name as full_name
from Contacts c
UNNEST c.assessees a
where c._type = 'divorce_lead'

This is what my output looks like right now

[{
“_id”: “03456a1d-c3c9-4b77-87fe-1cd81afc66c2”,
“full_name”: “CHRISTENSEN,MARIA A TRUST”
},
{
“_id”: “03456a1d-c3c9-4b77-87fe-1cd81afc66c2”,
“full_name”: “CHRISTENSEN”
},
{
“_id”: “03c482e9-30e5-45f3-8206-09fc31075977”,
“full_name”: “NABILA NAWABI”
},
{
“_id”: “03c482e9-30e5-45f3-8206-09fc31075977”,
“full_name”: “MOHAMMAD ATTA”
}]

What i would like to get back is this

{
“_id”: “03456a1d-c3c9-4b77-87fe-1cd81afc66c2”,
“full_name”: [
“CHRISTENSEN,MARIA A TRUST”,
“CHRISTENSEN”
] },
{
“_id”: “03c482e9-30e5-45f3-8206-09fc31075977”,
“full_name”: [
“NABILA NAWABI”,
“MOHAMMAD ATTA”
] } ]


#2
SELECT  c._id,  c.assessees[*].full_name 
FROM Contacts c
WHERE  c._type = 'divorce_lead'