Default upsert flag when using updateMany operation


i´ve had an issue with using updateMany as update aggregation on collection to update structure of our entity including embedded documents.

We are using a sharded environment. As i tried to update all documents, there occured an exception to include full shard key inside filter criteria if using updateMany with upsert: true. But normally upsert flag should be false as default like specified in official documentation. Nevertheless i had to include upsert: false as explicit parameter to deactivate upsert functionality.

Is there something i have missed or missunderstood?

Thank you,

Best regards


Hi @Philipp_Allstadt ,

That does sound wierd as upsert is by default false.

What driver and version you use against what MongoDB cluster?


Hi @Pavel_Duchovny ,

i used mongosh to run updateMany operation.

Our cluster runs on 5.0.13 and mongosh vesion is 1.3.1.