[MarkLogic Dev General] Forests and Collections querying problem
dsokolsky at marklogic.com
Fri Aug 8 10:32:04 PDT 2008
When you load documents into a database, unless you explicitly state the
forest to which it is loaded (with a forest placement key), the system
will automatically choose a forest for each document during the load
process (this explains why you see "the forests randomly increment their
How did these documents get in the MDCOL collection? You can do that
upon load or after load with xdmp:document-set-collections. If the
following query against the MDE database returns 0:
it means there are no documents in that collection named MDCOL. Your
query seems like it should return all the document in the collection
(although I am not good at java string escaping...). Maybe there are
actually no documents in that collection? Maybe the name was
misspelled, either on load or on query?
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Darren
Sent: Friday, August 08, 2008 10:04 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] Forests and Collections querying
I want to store a document in a forest and collection. The document is
part of a collection "MDCOL". I currently have 2 forests associated with
my database MDE - they are "MDR" and "MDC". When I connect through XCC
(to the MDE database) and store a document labeled for the "MDC"
collection. I see the forests randomly increment their document count.
Sometimes its the MDR forest, sometimes the MDC. Furthermore, when I
query for all documents in the MDCOL collection, I get none.
Request request = session.newAdhocQuery ("for $doc in
fn:collection(\"MDCOL\") return $doc",options);
The documentation didn't explain querying collections well enough
to solve this in short period. Can someone offer a tip?
General mailing list
General at developer.marklogic.com
More information about the General