Mongodb Update Multiple Document, Insert if not Exist

Mongodb Update Multiple Document, Insert if not Exist

If upsert:true is set then mongodb insert new document if exist. My below query working fine for single document. Unique Index:- {fid:1,uniqueid:1,atype:1,ftype:1}

If upsert:true is set then mongodb insert new document if exist. My below query working fine for single document. Unique Index:- {fid:1,uniqueid:1,atype:1,ftype:1}

db.Notification.updateMany(
  {fid : 103,uniqueid:1001,atype:1,ftype:6}
  ,{ $set: { epoch: 1548484978658,actionbyuserid: 110, title: 'Good Morning To All'}}
  ,{upsert:true}
);

But when execute below query it is not inserting new documents for not matched documents;

db.Notification.updateMany(
 {fid : {$in:[101,102,103]},uniqueid:1001,atype:1,ftype:6}
  ,{ $set: { epoch: 1548484978658,actionbyuserid: 110, title: 'Good Morning To All'}}
,{upsert:true}
)

Is there other to check and insert not found documents ?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB - Part 3/3

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB - Part 1/3

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB - Part 2/3

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB