Skip to content

Commit

Permalink
Revert MongoDB adapter change
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Dec 20, 2022
1 parent a425d1b commit 1d83eaa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/mongodb/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ export class MongoDbAdapter<
? model
.insertMany(data.map(setId), writeOptions)
.then(async (result) =>
model.find({ _id: { $in: Object.values(result.insertedIds) } }, params.mongodb).toArray()
Promise.all(
Object.values(result.insertedIds).map(async (_id) => model.findOne({ _id }, params.mongodb))
)
)
: model
.insertOne(setId(data), writeOptions)
Expand Down

0 comments on commit 1d83eaa

Please # to comment.