|
@@ -233,10 +233,12 @@ class MongodbHandler:
|
|
if (len(data) == 1) or (isinstance(data, dict)):
|
|
if (len(data) == 1) or (isinstance(data, dict)):
|
|
|
|
|
|
if isinstance(data, pd.DataFrame) and (len(data) == 1):
|
|
if isinstance(data, pd.DataFrame) and (len(data) == 1):
|
|
- data = data.iloc[0]
|
|
|
|
|
|
+ insert_data = data.iloc[0]
|
|
elif type(data) is list:
|
|
elif type(data) is list:
|
|
- data = data[0]
|
|
|
|
- self._database[collection_name].insert_one(data)
|
|
|
|
|
|
+ insert_data = data[0]
|
|
|
|
+ else:
|
|
|
|
+ insert_data = data
|
|
|
|
+ self._database[collection_name].insert_one(insert_data)
|
|
else:
|
|
else:
|
|
self._database[collection_name].insert_many(data, ordered=ordered)
|
|
self._database[collection_name].insert_many(data, ordered=ordered)
|
|
|
|
|