Skip to content

Commit

Permalink
fix(mongo): fix incorrect orm implementation, fix #188
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 1, 2021
1 parent ed1e2d0 commit d5c707f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-mongo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Database.extend(MongoDatabase, {
if (!key || key === primary) key = '_id'
const bulk = this.db.collection(name).initializeUnorderedBulkOp()
for (const item of data) {
bulk.find({ [key]: data[primary] }).updateOne({ $set: omit(item, [primary]) })
bulk.find({ [key]: item[primary] }).updateOne({ $set: omit(item, [primary]) })
}
await bulk.execute()
},
Expand Down

0 comments on commit d5c707f

Please sign in to comment.