Skip to content

Commit

Permalink
fix ps per batch
Browse files Browse the repository at this point in the history
  • Loading branch information
BellaCs committed Jun 14, 2024
1 parent 7478682 commit bbe4bb3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sippers/backends/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def insert(self, document):
if batch_insert:
ps_data = []
for x in docuemnt_list:
x.get('measure_cnmc').backend = self
ps_data.append(x.get('measure_cnmc').backend_data)
x.get('ps').backend = self
ps_data.append(x.get('ps').backend_data)
else:
ps.backend = self
ps_data = ps.backend_data
Expand Down Expand Up @@ -81,6 +81,7 @@ def insert_ps(self, ps, collection=None):
key = 'cups'

if isinstance(ps, list):
oid = False
for doc in ps:
oid = self.db[collection].update(
{key: doc[key]}, doc, upsert=True
Expand Down

0 comments on commit bbe4bb3

Please sign in to comment.