开发者

App Engine query for all objects with an existing property

开发者 https://www.devze.com 2023-03-12 12:11 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消