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

北城以北 提交于 2019-12-13 10:23:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!