What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-15 07:40:19
add new field in mongodb collection
Same as the updating existing collection field, $set will add a new fields if the specified field does not exist. Check out this example: > db.foo.find() > db.foo.insert({"test":"a"}) > db.foo.find() { "_id" : Obje... Add solution