You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/faq.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -456,15 +456,15 @@ await doc.save();
456
456
457
457
To fix this error, either:
458
458
459
-
1) Load the full array before modifying and saving:
459
+
(1) Load the full array before modifying and saving:
460
460
461
461
```javascript
462
462
constdoc=awaitBlogPost.findById(_id);
463
463
doc.comments.id(commentId).text='Updated';
464
464
awaitdoc.save();
465
465
```
466
466
467
-
2) Or use `updateOne()` / `updateMany()` with positional operators or `arrayFilters` so MongoDB can update the array atomically without requiring the full array on the document:
467
+
(2) Or use `updateOne()` / `updateMany()` with positional operators or `arrayFilters` so MongoDB can update the array atomically without requiring the full array on the document:
0 commit comments