What is the recommended way to get the total number of entities of a kind stored in the datastore in dart?

Viewed 109

We are using the gcloud dart library to access the datastore. We would like to display the total number of users.

Of course, the simplest way to do this is:

db.query(User).run().length

but this would fetch all users.

Is there a way to run this query efficiently with the dart gcloud library? If not, will querying for all entities be a big performance issue and should we store the total number of users in a separate entity?

1 Answers
Related