Is there a way to join 2 documents within a marklogic database utilizing MarkLogic's Java API?
For instance let's say there's the following 2 documents:
doc1.xml:
<a>
<id>123</id>
<doc2ID>111</doc2ID>
<first_name>John</first_name>
</a>
doc2.xml:
<b>
<id>111</id>
<doc1ID>123</doc1ID>
<last_name>Smith</last_name>
<age>25</age>
</b>
Can i make the following query in MarkLogic: retrieve all records where first name = John, last_name = Smith and age > 20 ? In sql you would do something like this: Select a.first_name, b.last_name from doc1 a JOIN doc2 b ON (a.doc2ID = b.id) WHERE a.first_name = 'John' and b.last_name = 'Smith' and b.age > 24