airflow.contrib.sensors.mongo_sensor

Module Contents

class airflow.contrib.sensors.mongo_sensor.MongoSensor(collection, query, mongo_conn_id='mongo_default', *args, **kwargs)[source]

Bases: airflow.sensors.base_sensor_operator.BaseSensorOperator

Checks for the existence of a document which matches the given query in MongoDB. Example:

>>> mongo_sensor = MongoSensor(collection="coll",
...                            query={"key": "value"},
...                            mongo_conn_id="mongo_default",
...                            task_id="mongo_sensor")
template_fields = ['collection', 'query'][source]
poke(self, context)[source]