App Engine query for all objects with an existing property
I'd like to do 开发者_运维问答a query that returns all entities for which a particular property exists. I don't care about the vale of the property, just that it exists. What is a good way to do this on python for app engine?
Thanks!
Filtering Or Sorting On a Property Requires That the Property Exists
If a property has a query filter condition or sort order, the query returns only those datastore entities that have a value (including null) for that property.
http://code.google.com/appengine/docs/python/datastore/queries.html#Restrictions_on_Queries
So just sort your results by the field you want to check for existence.
精彩评论