Created
December 30, 2014 19:04
-
-
Save patkujawa-wf/45288cbb9ff704410d78 to your computer and use it in GitHub Desktop.
Projection query example in google app engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from http://ae-book.appspot.com/static/pgae-ndb-20121009.pdf | |
# Video at https://www.youtube.com/watch?v=xZsxWn58pS0#t=2970 | |
query = Player.query() | |
results = query.fetch(20, | |
projection=[Player.name, Player.level]) | |
for player in results: | |
# player.name ... | |
# (player.score not set) | |
# Projected property values are pulled directly from | |
# the index, and so must all be indexed properties. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment