Exemple #1
0
 def store_records(self):
     '''
     method to store each record into mongodb
     :return:
     '''
     json_data = File_Handle.read_json()
     csv_rec = File_Handle.Csv_read(json_data['path'])
     try:
         for each_record in csv_rec:
             if each_record not in self.db_config.find(
                     json_data['order_ID']):
                 MongoDB.insert_record(each_record)
     except Exception as e:
         return e
     else:
         return 'records inserted successfully'