Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyMongoDBupsert basicsSingle-choice MCQ

An updateOne with upsert: true matches no existing document. Which fields are written into the newly inserted document?

db.col.updateOne( { sku: 'A1' }, { $set: { qty: 10 } }, { upsert: true } )