问题
I'm performing an xquery over a set of xml documents. Then I'm reading it from another workspace using a web service. The result that I'm getting is half of the number of records stored in Marklogic. I have 764 xml records and I'm getting the results of 382 records. I want to make sure that Marklogic is not skipping any record by knowing the number of the number of records returned by an xquery? And If it is possible I want to know if I can force Marklogi to perform the xquery on all of the records in my database.
回答1:
Are you certain your QueryConsole workspace is pointing to the correct database?
The closest thing to "force MarkLogic to perform the XQuery on all of the records in the database" would be to execute fn:count(fn:doc())
What is the count from that? If you get back 764 then the discrepancy is likely because not all 764 records match your query. We'd need to have more information about your specific query (and the structure of your data) in order to help troubleshoot with specificity.
Permissions might also be something to consider- make sure that your webservice is running as a user that has at least read privileges on all of the documents in the database.
来源:https://stackoverflow.com/questions/39610209/marklogic-how-to-know-the-number-of-records-returned-by-an-xquery