Hi Gaya, I am a bit confused by your XML fragment. It not well-formed XML. The decimal number, is that an attribute name, attribute value or the value of the element itself? And is each <doc_key> element stored as a separate document or are they part of one large file?
Next to this, it is less optimal to access across databases. You will need an xdmp:eval with database-id option to retrieve documents from one database to compare them with documents from another. It is better to put all documents in one database and logically separate them by putting them in a separate directory or collection.. Kind regards, Geert > drs. G.P.H. (Geert) Josten Consultant Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 mailto:[email protected] http://www.daidalos.nl/ KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of Gaya Rac > Sent: woensdag 31 maart 2010 16:32 > To: General Mark Logic Developer Discussion > Subject: Re: [MarkLogic Dev General] Inner join > > Thanks Lee. > If we want to find matching records from all the XMLs in > database: DB1 with all the XMLs in database: DB2, then we > need to access DB2 from DB1 and then perform the join right? > > Also the doc_key element, has an attribute field > doc_key_context and we want to find matching records based on > <doc_key doc_key_context="a" 20021234> > > > On Wed, Mar 31, 2010 at 10:17 AM, Lee, David > <[email protected]> wrote: > > > for $a = doc("DB1.xml")//doc_key > > for $b = doc("DB2.xml")//doc_key > > where $a/doc_key_context eq $b/doc_key_context > > return .. > > > > From: [email protected] > [mailto:[email protected]] On Behalf Of Gaya Rac > Sent: Tuesday, March 30, 2010 12:07 PM > To: [email protected] > Subject: [MarkLogic Dev General] Inner join > > > > Hi, > > Is there a way to perform joins on Mark logic databases? > > I've a database:DB1 which has key field > <doc_key doc_key_context="a" 20021234> > <doc_key doc_key_context="b" 1234> > > I've a second database:DB2 which has same key field > <doc_key doc_key_context="a" 20021234> > <doc_key doc_key_context="b" 1234> > > How can I return all the matching documents from DB1, DB2. > > Thanks, Gayathri > > > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general > > > > > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
