Ejemplo n.º 1
0
def get_mongodb():
    mongodb_test = MongoHook(conn_id='mongodb_id')
    data = mongodb_test.find('order_item', {})
    data = list(map(map_data, data))
    mongodb_test.insert_many('order_item', data)
    data = mongodb_test.find('order_item', {})
    data = list(map(map_data, data))
    print(data)
Ejemplo n.º 2
0
 def poke(self, context):
     self.log.info(
         "Sensor check existence of the document "
         "that matches the following query: %s", self.query)
     hook = MongoHook(self.mongo_conn_id)
     return hook.find(self.collection, self.query,
                      find_one=True) is not None
Ejemplo n.º 3
0
 def poke(self, context):
     self.log.info("Sensor check existence of the document "
                   "that matches the following query: %s", self.query)
     hook = MongoHook(self.mongo_conn_id)
     return hook.find(self.collection, self.query, find_one=True) is not None