Using the AppEngine-MapReduce in the Google App Engine, what is the easiest way to parse objects for a specific date range?

I am trying to use AppEngine-MapReduce. I understand how to perform an operation on all objects of a certain entity_kind object, but what is the easiest way to work only with objects in a data range when an object has a date attribute? Is there an easy way to pass parameters to mapper?

For example, what if I only wanted to delete objects, where:

entity.created >= start and entity.created < stop class Entity(db.Model): created = db.DateTimeProperty() from mapreduce import operation as op def process(entity): yield op.db.Delete(entity) 
+4
source share
2 answers

There is currently no way to iterate over a request in mapreduce - you must iterate over all entities of a given type. Instead, you should apply a filter to the map function and remove only those objects that match.

+3
source

Since commit324 , you can use limited query filters as input.

If this does not allow you to do what you want, there is a small extension that you can try.

0
source

All Articles