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)
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
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