views:

59

answers:

2

When you change data models on the app engine to add new properties those entries without a certain property are listed with the value <missing> in the online data viewer.

What I'm wondering is how can I write a query to find those entries?

+1  A: 

There's no way to query the datastore for entities that don't have a given property. You need to iterate over all the entities and check each one - possibly by using the mapreduce API.

Nick Johnson
+2  A: 

There is no direct way to query for older entities with missing attribute, but you can design data model upfront to support this. Add a version attribute to each model class. Version should have a default value, which is increased every time model class is changed and deployed. This way you will be able to query entities by version number.

Constantin
Hmm ... now if only I had thought of this before. Would probably be a good idea to implement now :)
Swizec Teller