1
votes

I have created a NDB Model

class Account(ndb.Model):
   accId = ndb.StringProperty()
   firstName = ndb.StringProperty()
   lastName = ndb.StringProperty()

So now I need to query on this model and get account Id's of all people having firstName as Mark. So I wrote the query...

acc_obj = Account.gql("WHERE firstName = :1","Mark")

But using the above query whenever I print count it limits to 1000 only.

print acc_obj.count()

I know that the count is more than 1000 but somehow the gql query fetches on 1000 entities at one time.

  • So why there is this limitation (explanation)?

  • And what is the other alternative to fetch all other records at once without using limit,cursor?

1

1 Answers

0
votes

It looks like there used to be a hard limit that got lifted:

Google App Engine - getting count of records that match criteria over 1000

But maybe it only got lifted for certain mechanisms and not others.

For example in the remote api-shell, the 1000 limit still exists

https://issuetracker.google.com/issues/35893498

If you are able to recreate your query in NDB, you won't experience the limit:

google app engine NDB records counts from NDB model