How does one get a count of rows in a Datastore model in Google App Engine?

后端 未结 8 1903
日久生厌
日久生厌 2020-12-05 10:13

I need to get a count of records for a particular model on App Engine. How does one do it?

I bulk uploaded more than 4000 records but modelname.count() only shows me

8条回答
  •  孤街浪徒
    2020-12-05 10:41

    This is a very old thread, but just in case it helps other people looking at it, there are 3 ways to accomplish this:

    1. Accessing the Datastore statistics
    2. Keeping a counter in the datastore
    3. Sharding counters

    Each one of these methods is explained in this link.

提交回复
热议问题