[DOCS-6515] document update sample need acorrection Created: 03/Nov/15 Updated: 11/Jan/17 Resolved: 03/Nov/15 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | mongodb-3.0 |
| Fix Version/s: | 01112017-cleanup |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | John Du | Assignee: | Kay Kim (Inactive) |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
CentOS 7.1, MongoDB shell version: 3.0.6, AWS EC2 |
||
| Participants: | |
| Days since reply: | 8 years, 15 weeks, 1 day ago |
| 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: db.restaurants.update( , } db.restaurants.update( , } |
| Comments |
| Comment by John Du [ 03/Nov/15 ] | ||||||||
|
I Kay, That was my fault: there were two document had the same restaurant id Sorry for the confuse. Thanks for your time. Regards, John Du 630-788-6708 | ||||||||
| Comment by Kay Kim (Inactive) [ 03/Nov/15 ] | ||||||||
|
Hi –
Then, because the document has been replaced and the replacement document did not contain a "restaurant_id" field, the following operation does not match any document:
However, doing a find by the new name "Vella 2" does return the document
| ||||||||
| Comment by John Du [ 03/Nov/15 ] | ||||||||
|
Not sure how could "restaurant_id" : "41704620" be shown as an element of the "address" in the description - jira bug? | ||||||||
| Comment by John Du [ 03/Nov/15 ] | ||||||||
|
the sample code should be: db.restaurants.update( { "restaurant_id" : "41704620" }, } |