Details
-
Improvement
-
Resolution: Cannot Reproduce
-
Minor - P4
-
mongodb-3.0
-
None
-
CentOS 7.1, MongoDB shell version: 3.0.6, AWS EC2
Description
The issue was found in this document url: https://docs.mongodb.org/getting-started/shell/update/#update-data-with-the-mongo-shell
Where "Replace a Document" section the sample code not working:
in the document"
"After the following update, the modified document will only contain the _id field, name field, the address field. i.e. the document will not contain the restaurant_id, cuisine, grades, and the borough fields.
db.restaurants.update(
,
{
"name" : "Vella 2",
"address" :
}
)
"
the document did not get replaced but only the fields updated. Adding "restaurant_id" : "41704620" in the new document section, the document got replaced. The sample code should be as following:
db.restaurants.update(
,
{
"name" : "Vella 2",
"address" :
}
)