Javatpoint Logo
Javatpoint Logo

Node.js MongoDB Remove

In MongoDB, you can delete records or documents by using the remove() method. The first parameter of the remove() method is a query object which specifies the document to delete.


Remove the record of employee whose address is Ghaziabad.

Create a js file named "remove.js", having the following code:

Open the command terminal and run the following command:

Node.js Remove 1


You can check that the record having address "Ghaziabad" is deleted and only following records are available now:

Node.js Remove 2

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA