Marklogic:如何知道xquery返回的记录数? [英] Marklogic: How to know the number of records returned by an xquery?

查看:168
本文介绍了Marklogic:如何知道xquery返回的记录数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在对一组xml文档执行xquery.然后,我使用Web服务从另一个工作区中读取它. 我得到的结果是Marklogic中存储的记录数的一半.我有764条xml记录,并且得到382条记录的结果. 我想通过知道xquery返回的记录数来确保Marklogic不会跳过任何记录?如果可能的话,我想 知道我是否可以强制Marklogi对数据库中的所有记录执行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.

推荐答案

您确定您的QueryConsole工作区指向正确的数据库吗?

Are you certain your QueryConsole workspace is pointing to the correct database?

与强制MarkLogic对数据库中的所有记录执行XQuery"最接近的事情是执行fn:count(fn:doc())

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())

从中算出什么?如果您返回764,则可能存在差异,因为并非所有764记录都与您的查询匹配.我们需要有关您的特定查询(以及数据的结构)的更多信息,以帮助进行特定性故障排除.

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.

可能还需要考虑权限-确保您的Web服务以对数据库中所有文档至少具有读取特权的用户身份运行.

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.

这篇关于Marklogic:如何知道xquery返回的记录数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆