We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f886640 commit fe22615Copy full SHA for fe22615
1 file changed
packages/mongodb/src/adapter.ts
@@ -215,15 +215,18 @@ export class MongoDbAdapter<
215
216
return entry
217
}
218
+
219
const promise = Array.isArray(data)
220
? model
221
.insertMany(data.map(setId), writeOptions)
222
.then(async (result) =>
- Promise.all(Object.values(result.insertedIds).map(async (_id) => model.findOne({ _id })))
223
+ Promise.all(
224
+ Object.values(result.insertedIds).map(async (_id) => model.findOne({ _id }, params.mongodb))
225
+ )
226
)
227
: model
228
.insertOne(setId(data), writeOptions)
- .then(async (result) => model.findOne({ _id: result.insertedId }))
229
+ .then(async (result) => model.findOne({ _id: result.insertedId }, params.mongodb))
230
231
return promise.then(select(params, this.id)).catch(errorHandler)
232
0 commit comments