Which MongoDB command is used to add a new field to an existing document? - Study24x7
Social learning Network
5 followers study24x7 05 Dec 2024 10:55 AM study24x7 study24x7

Which MongoDB command is used to add a new field to an existing document?

A

db.collection.update({}, {$set: {newField: value}})

B

db.collection.add({}, {newField: value})

C

db.collection.newField({newField: value})

D

db.collection.addField({newField: value})

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles