Hi All,
Please help me with the N1QL query to achieve merged document.
I have below two documents in the same bucket, where value of cpm_id is the document key
[
{
“cdb_id”: “1001”,
“cpm_id”: “profile_1001”, //KEY value
“phone”:“1234”,
“email":"abc@fd.com”
},
{
“cdb_id”: “1001”,
“gala_id”:“9100”,
“cpm_id”: “profile_9100”, //KEY value
“phone”:“2006”,
“email":"xyz@fd.com”
}
}
I want to update phone and email from 1st document to 2nd document, where cdb_id value is common and field gala_id does not contain in 1st document.
Below is the expected output for above example: -
[
{
“cdb_id”: “1001”,
“cpm_id”: “profile_1001”, //KEY value
“phone”:“1234”,
“email":"abc@fd.com”
},
{
“cdb_id”: “1001”,
“gala_id”:“9100”,
“cpm_id”: “profile_9100”, //KEY value
“phone”:“1234”,
“email":"abc@fd.com”
}
}
Thank you,
Regards,
Jayant