Did insertOne in Node.js v4 change to not return the inserted doc?

Hi @Alex_Bjorlig,

It is new in driver v4 that our driver is compliant with the MongoDB CRUD spec

When you insertOne you now get the insertedId, so that should provide the only “new” part of the document that’s handled by the database.

const myDoc = { a: 1 }
myDoc._id = (await c.insertOne(myDoc)).insertedId
// myDoc is now the same as the doc inserted into mongodb :slight_smile:

3 Likes