Skip to main content

Command Palette

Search for a command to run...

Explain the SET Modifier in MongoDB?

Updated
1 min read
Explain the SET Modifier in MongoDB?
R

Full Stack Developer with a passion for building web applications. PHP, Node.js, Laravel, MySQL, MongoDB. Love collaborating & making a difference

The $set operator replaces the value of a field with the specified value. If the field does not exist, $set will add a new field with the specified value, provided that the new field does not violate a type constraint.

Sources:

$Set — MongoDB Manual. www.mongodb.com/docs/manual/reference/operator/update/set.

More from this blog

R

Raja Muhammad Asher - Senior Software Engineer - Full Stack Developer

157 posts

Full Stack Developer with a passion for building web applications. PHP, Node.js, Laravel, ExpressJS, MySQL, MongoDB. Love collaborating & making a difference