Reputation: 1723
I am using gstore-node package for querying data from Google Datastore.
I did not find anywhere how to get the total record count of the query using gstore-node.
Please help me out if anyone knows.
Thanks in advance.
Upvotes: 1
Views: 794
Reputation: 2887
There isn't a server side COUNT function in Cloud Datastore. 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.
Upvotes: 1