[DOCS-13537] updateMany documentation is missleading Created: 21/Mar/20 Updated: 30/Oct/23 Resolved: 28/Aug/20 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sasha Rudan | Assignee: | Dave Cuthbert (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | docs-query, docs-server-onboarding | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
"dependencies": { "@types/mongodb": "^3.5.2", "@types/mongoose": "^5.7.6", "bson": "^0.4.22", "mongoose": "^5.9.4" }, node -v mongod -v |
||
| Participants: | |
| Days since reply: | 3 years, 23 weeks, 5 days ago |
| Epic Link: | DOCSP-1769 |
| Description |
DescriptionAcross different documentation updateMany differs: In: https://github.com/mongodb/docs/blob/v4.2/source/tutorial/update-documents.txt https://github.com/mongodb/docs/blob/v4.2/source/reference/method/db.collection.updateMany.txt
Somewherre is shown as:
```js db.<collection>.updateMany({}, {$set: {a: 1);}} ``` {{}} and somewhere as with brackets `[]`: {{}} ```js db.<collection>.updateMany({}, [ {$set: {a: 1 ]);}} {{}} Additionally, Mongoose documentation is missing about this command, and using the case without brackets silently changes no document. ```{{}} Scope of changesImpact to Other DocsMVP (Work and Date)Resources (Scope or Design Docs, Invision, etc.) |
| Comments |
| Comment by Dave Cuthbert (Inactive) [ 28/Aug/20 ] |
|
In some cases the examples use `[]` for lists of fields. When the updates are applied to a single field `[]` are not used. |