AppEngine: Query datastore for records with value

后端 未结 2 1093
忘了有多久
忘了有多久 2020-12-05 14:03

I created a new property for my db model in the Google App Engine Datastore.

Old:

class Logo(db.Model):
  name = db.StringProperty()
  image = db.Blo         


        
2条回答
  •  借酒劲吻你
    2020-12-05 14:47

    According to the App Engine documentation on Queries and Indexes, there is a distinction between entities that have no value for a property, and those that have a null value for it; and "Entities Without a Filtered Property Are Never Returned by a Query." So it is not possible to write a query for these old records.

    A useful article is Updating Your Model's Schema, which says that the only currently-supported way to find entities missing some property is to examine all of them. The article has example code showing how to cycle through a large set of entities and update them.

提交回复
热议问题