Node.js MongoDB Remove Record

In this tutorial you will learn about the Node.js MongoDB Remove Record and its application with practical example.

Node.js MongoDB Remove Record

The remove() method is used to remove a record from a MongoDB collection, you have to pass search parameters using query object to specify the records to be removed.

Example :- Let’s remove a records from “employees” collection where emp_name is “Keith”.

Step 1:- Let’s, create a node_mongo_remove.js file and put the following code in it –

Step 2:- Save the code and open the terminal again, and type the following command in order to run the file.

you will see following output on terminal –

Output:-

 

In this tutorial we have learn about the Node.js MongoDB Remove Record and its application with practical example. I hope you will like this tutorial.