Skip to content

Commit

Permalink
Merge branch 'next' into feature/prod-cicd-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik authored Jul 8, 2024
2 parents f887353 + dc67058 commit 2830c72
Show file tree
Hide file tree
Showing 2 changed files with 6,111 additions and 9,132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,29 @@ export class DoReReview extends BaseReview {
uniqueItems[field].add(item.record[field]);
});
});
const bulkOperations = [];
for (const key of Object.keys(uniqueItems)) {
const itemsArray = Array.from(uniqueItems[key]);
// Iterate over each value in unique field
for (const item of itemsArray) {
// update first occurance of data
bulkOperations.push({
updateOne: {
filter: { [`record.${key}`]: item },
update: { $set: { [`updated.${key}`]: true } },
},
});
// update second occurance of data for validity
bulkOperations.push({
updateOne: {
filter: { [`record.${key}`]: item, [`updated.${key}`]: false },
update: { $set: { [`updated.${key}`]: true } },
},
});
}
uniqueItems[key].clear();
}
await this._modal.bulkWrite(bulkOperations);

let result: ISaveResults = {
uploadId: _uploadId,
Expand Down
Loading

0 comments on commit 2830c72

Please sign in to comment.