Hi,
I thought about the “id” as it duplicates. Lets have a slight different scenario

/1.json:
{“id”:”1”, “fname”:”Scott”}

/2.json:
{“lname”:”McNelay”}
Expected result:

/12.json
{
“id”:””,
“fname”:”Scott”,
“lname”:”McNelay”
}


Regards
Siva.
From: 
<[email protected]<mailto:[email protected]>>
 on behalf of Justin Makeig 
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, August 16, 2016 at 4:39 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] How to merge two json document in to 
another document in MarkLogic

What does is the merged document supposed to look like? What is the logic when 
key names collide? Last wins?

Justin

On Aug 16, 2016, at 1:34 PM, Siva Viswabrahmana - Contractor 
<[email protected]<mailto:[email protected]>> wrote:

Hi,

/1.json:
{“id”:”1”, “fname”:”Scott”}

/2.json:
{“id”:”2”, “lname”:”McNelay”}

Hope this works.

—Siva.

From: 
<[email protected]<mailto:[email protected]>>
 on behalf of Justin Makeig 
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, August 16, 2016 at 4:31 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] How to merge two json document in to 
another document in MarkLogic

Can you show an examples of 1.json, 2.json, and 12.json? It's unclear what you 
mean by merge.

Justin

--
Justin Makeig
Director, Product Management
MarkLogic
[email protected]<mailto:[email protected]>

On Aug 16, 2016, at 1:19 PM, Siva Viswabrahmana - Contractor 
<[email protected]<mailto:[email protected]>> wrote:

Hi,
I am trying to merge /1.json +/2.json into /12.json

Below query does not allow another document{…}

xdmp:document-insert("/test/2.json",document { doc("/test/1.json") 
},(),("aggregate")),
doc("/test/2.json”);

Pls advise.

Regards
Siva.

From: 
<[email protected]<mailto:[email protected]>>
 on behalf of Rob Szkutak 
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, August 16, 2016 at 4:16 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] How to merge two json document in to 
another document in MarkLogic

Hello,

Could you be more specific about what you're trying to accomplish? A sample of 
the structure of your two documents and the merged format you would like to put 
them in would be helpful in understanding how to assist you.

Best,
Rob

Rob Szkutak
Senior Consultant
MarkLogic Corporation
[email protected]<mailto:[email protected]>
www.marklogic.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.marklogic.com&d=DQMFAw&c=l2yuVHfpC_9lAv0gltv6ZQ&r=cN7CeyOq0lJM02AripOo2ttwg5D3eXuv33TcKhL4pCc&m=rNydfvxVonydW6JhTkm2obiz9yoCm1Xc6bz9NItJESQ&s=upWKrIYFG07ljVGDMxSd98ACdlKEv9wQruWfiO4l7t0&e=>

________________________________
From: 
[email protected]<mailto:[email protected]>
 
[[email protected]<mailto:[email protected]>]
 on behalf of Siva Viswabrahmana - Contractor 
[[email protected]<mailto:[email protected]>]
Sent: Tuesday, August 16, 2016 3:11 PM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] How to merge two json document in to another 
document in MarkLogic

Hi,
How to merge two json document in to another document in MarkLogic?

Regards
Siva.
Confidentiality Note


This message is intended for the use of the person or entity to which it is 
addressed and may contain information, including health information, that is 
privileged, confidential, and the disclosure of which is governed by applicable 
law. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
information is STRICTLY PROHIBITED.

If you have received this in error, please notify us immediately and destroy 
the related message.
Confidentiality Note


This message is intended for the use of the person or entity to which it is 
addressed and may contain information, including health information, that is 
privileged, confidential, and the disclosure of which is governed by applicable 
law. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
information is STRICTLY PROHIBITED.

If you have received this in error, please notify us immediately and destroy 
the related message. _______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general

Confidentiality Note


This message is intended for the use of the person or entity to which it is 
addressed and may contain information, including health information, that is 
privileged, confidential, and the disclosure of which is governed by applicable 
law. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
information is STRICTLY PROHIBITED.

If you have received this in error, please notify us immediately and destroy 
the related message.
_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general

Confidentiality Note


This message is intended for the use of the person or entity to which it is 
addressed and may contain information, including health information, that is 
privileged, confidential, and the disclosure of which is governed by applicable 
law. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
information is STRICTLY PROHIBITED.

If you have received this in error, please notify us immediately and destroy 
the related message.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to