Removing Documents by Using Mongoose

There are two main options for removing objects from a collection using Mongoose. First, you can use the remove() method on either the Document object for a single deletion or on the Model object to delete multiple documents in the model. Deleting a single object is often convenient if you already have a Document instance. However, it is often much more efficient to delete multiple documents at the same time at the model level. The following sections describe these methods.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.145.217