Search code examples
google-app-enginegoogle-cloud-datastoregql

Placement of sorted entry in Google App Engine Datastore


I'd like to determine what place a particular entry is in, but the appropriate GQL query is escaping me. Ideally I'd like to know the following details, which seem like they should be known by the Datastore. I just can't seem to figure how to determine it. Can someone help?

  • the placement of a particular entry (in a given sorting, i.e. by a particular property)
  • the total number of entries that exist (w/o retrieving them, just the count)
  • the next entry in the list (I figure as long as I can get the placement, I can make the right query to get the next one by simply getting 2 and taking the latter)

Can someone help?


Solution

  • If you're using Python, check out the google-app-engine-ranklist project, which implements a rank list in the App Engine datastore.