File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ By [chaining promises](https://javascript.info/promise-chaining) we could keep t
418418``` js
419419Note .find ({})
420420 .then (notes => {
421- return notes[0 ].remove ()
421+ return notes[0 ].deleteOne ()
422422 })
423423 .then (response => {
424424 console .log (' the first note is removed' )
@@ -444,7 +444,7 @@ The slightly complicated example presented above could be implemented by using a
444444
445445``` js
446446const notes = await Note .find ({})
447- const response = await notes[0 ].remove ()
447+ const response = await notes[0 ].deleteOne ()
448448
449449console .log (' the first note is removed' )
450450```
@@ -462,7 +462,7 @@ const main = async () => { // highlight-line
462462 const notes = await Note .find ({})
463463 console .log (' operation returned the following notes' , notes)
464464
465- const response = await notes[0 ].remove ()
465+ const response = await notes[0 ].deleteOne ()
466466 console .log (' the first note is removed' )
467467}
468468
@@ -581,7 +581,7 @@ const initialNotes = [
581581const nonExistingId = async () => {
582582 const note = new Note ({ content: ' willremovethissoon' })
583583 await note .save ()
584- await note .remove ()
584+ await note .deleteOne ()
585585
586586 return note ._id .toString ()
587587}
You can’t perform that action at this time.
0 commit comments