🔬
Moonlight.DB
GitHubNPM
  • Introduction
  • Getting Started
  • Documentation
    • Database
      • createCollection()
      • deleteCollection()
      • collections
    • Collection
      • find()
      • findOne()
      • update()
      • updateOne()
      • insertOne()
      • insertMany()
      • delete()
      • deleteOne()
      • length
Powered by GitBook
On this page
  • Example
  • update(<filter>, <options>)

Was this helpful?

  1. Documentation
  2. Collection

update()

Update multiple items in a collection

Example

db.collection("users").update({banned: false, xp: "99999"}, {
    "$set": {
        xp: "0"
    }
}).then(() => {
    //Items have been updated;
}).catch(error => {
    console.log("error:", error);
});

update(<filter>, <options>)

Parameter
Description

filter

The filter used to select the items to update

PreviousfindOne()NextupdateOne()

Last updated 2 years ago

Was this helpful?