[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
v12.10.0

mongod -v
db version v4.2.1


Participants:
Days since reply: 3 years, 23 weeks, 5 days ago
Epic Link: DOCSP-1769

 Description   

Description

Across 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 changes

Impact to Other Docs

MVP (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.

Generated at Thu Feb 08 08:08:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.