问题
What is the easiest and most efficient way to create an auto-increment counter for every data row in google appengine?
basically I want to give every row a unique row_number so that I can overcome the issue of only being able to get the first 1000 results in a select query. I can thus add a counter lies between condition and mine all the entires in the table.
回答1:
You don't need to keep track of row numbers, you can use cursors instead.
For Java see:
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Query_Cursors
For Python see:
http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Query_Cursors
来源:https://stackoverflow.com/questions/2894808/creating-auto-incrementing-column-in-google-appengine