简体   繁体   English

如何使用Gstore-Node从Google数据存储中获取总记录数?

[英]How can I get total records count from Google Datastore using Gstore-Node?

I am using gstore-node package for querying data from Google Datastore . 我正在使用gstore-node包从Google Datastore查询数据。

I did not find anywhere how to get the total record count of the query using gstore-node. 我没有找到任何地方如何使用gstore-node获取查询的总记录数。

Please help me out if anyone knows. 如果有人知道,请帮助我。

Thanks in advance. 提前致谢。

There isn't a server side COUNT function in Cloud Datastore. Cloud Datastore中没有服务器端COUNT功能。 So to get the count of results that match a query you'll need to run the query (in keys only mode is better) and count the results yourself after iterating through all the results. 因此,要获得与查询匹配的结果计数,您需要运行查询(在键模式下更好),并在遍历所有结果后自己计算结果。

Or you can follow the suggestion from Alfred in https://groups.google.com/forum/#!topic/gcd-discuss/XAssG40Fcz0/discussion and do a query like SELECT * FROM News LIMIT 0 OFFSET and look at the skipped_results value. 或者,您可以按照Alfred的建议在https://groups.google.com/forum/#!topic/gcd-discuss/XAssG40Fcz0/discussion中进行查询,例如SELECT * FROM News LIMIT 0 OFFSET并查看skipped_results值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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