Selecting a given property from a table in App Engine
-
18-09-2019 - |
Question
Is there a way to select only a given property from the App Engine datastore?
Imagine I have an User entity with many properties, but in a given moment I just want to fetch a list of user names (instead of fetching all properties for all users).
So, something equivalent to the following SQL: SELECT name FROM User;
I'm interested in all kinds of solutions (if any), python, java, low-level API, GQL... whatever...
Thanks
Solution
No. Entities are only ever fetched as a whole. If it's important to only fetch a limited set of properties, you need to refactor into multiple entities - eg, 'userinfo' and 'extrauserinfo' kinds.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow