diff --git a/packages/mongodb/src/adapter.ts b/packages/mongodb/src/adapter.ts index 7c8fb49adc..4461b5d52b 100644 --- a/packages/mongodb/src/adapter.ts +++ b/packages/mongodb/src/adapter.ts @@ -292,9 +292,7 @@ export class MongoDbAdapter< ? model .insertMany(data.map(setId), writeOptions) .then(async (result) => - Promise.all( - Object.values(result.insertedIds).map(async (_id) => model.findOne({ _id }, params.mongodb)) - ) + model.find({ _id: { $in: Object.values(result.insertedIds) } }, params.mongodb).toArray() ) : model .insertOne(setId(data), writeOptions)