开发者

Get Total number of records in gae datastore table

How to get the total number of re开发者_运维技巧cords in gae datastore table ?

Query

    result = db.GqlQuery("Select * from stocklist ORDER BY part_number")
    print result.count()

The output will shows 1000 only. But it will contails more than 5000 records. Why?


The count method has a default limit of 1000 which can be overridden.

ex. result.count(99999) will count up to 99,999 records.

The generally accepted best practice here is to use a sharded counter, so that you are doing the bulk of your work during the write operation rather than the read.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜