How to use updateMany query in PHP with MongoDB

Viewed 2733

In MongoDB 3.2 they have give update multiple documents with one query like below

try {
   db.inspectors.updateMany(
      { "inspector" : "J. Clouseau", "Sector" : 4 },
      { $set: { "Patrolling" : false } },
      { upsert: true }
   );
}
catch (e) {
   print(e);
}

I've checked php website for MongoDB for this query not having function for this.

2 Answers
Related