简体   繁体   中英

Marklogic: How to know the number of records returned by an xquery?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM