šŸ’
Cherry3
Support
  • 🄳Welcome
    • šŸ“•Change Log
  • šŸŽ—ļøModel & Schema
    • 🪔Usage & Options
  • šŸ’Operators
    • 🧵find()
    • 🧵allRows()
    • 🧵findOne()
    • 🧵findOneAndUpdate()
    • 🧵findOneAndDelete()
    • 🧵findById()
    • 🧵findByIdAndUpdate()
    • 🧵findByIdAndDelete()
    • 🧵insertOne()
    • 🧵insertMany()
    • 🧵updateOne()
    • 🧵updateMany()
    • 🧵deleteOne()
    • 🧵deleteMany()
    • 🧵create() & save()
    • 🧵schemaInfo()
    • 🧵dropCollection()
    • 🧵renameCollection()
    • 🧵renameColumn()
    • 🧵deleteColumn()
    • 🧵distinct()
    • 🧵countDocuments()
    • 🧵inspect()
    • 🧵aggregate()
  • šŸ”§Other Operators
    • šŸ†™Update Operators
      • ⚔$set
      • ⚔$unset
      • ⚔$inc
      • ⚔$dec
      • ⚔$push
      • ⚔$pull
      • ⚔$pop
    • šŸ“”Filter & Process Operators
      • ⚔$limit
      • ⚔$skip
      • ⚔$sort
      • ⚔$upsert
      • ⚔$multiPull
  • šŸŖSQL Config File
Powered by GitBook
On this page

Was this helpful?

  1. Other Operators
  2. Update Operators

$set

Name
Usage Type
Description

$set

Object

$set Operator Adjusts the Data on the Table with the Data Used in the Operator, You Can Think of It as a Sort of Bulk Write.

/* Example Usage */
const model = ...Someone Model

(async () => {

await model.findOneAndUpdate({ name: "Test" },{ $set:{ name: 'Five So Beş' } });
/*
The "name" value that was Test is now Five So Beş
*/

})();
PreviousUpdate OperatorsNext$unset

Last updated 1 year ago

Was this helpful?

šŸ”§
šŸ†™
⚔