## Step 7 : Deleting Records

I think by this stage, you have really started to get the idea of working with Mongo. That's right, if you want to delete a record, you have to pass in a set of selectors, as you also would with SQL, to determine the set of records to delete. If you don't do this, you will delete all records – and the database.

So, let's say that we don't want James Caan in our list of actors. Let's remove him from the database using the following command:

As with update, no visible output is provided to indicate whether we were successful or not – so let's do a search to double check.

After this, you should see no results returned. If that's what you've found, then we've successfully deleted James Caan from our database. But what if we want to delete all the records from the database?

Well, to do that, just remove the selectors from the previous call to remove, as below.

After running both commands above, we'll see no output, indicating that the database, with all records have now been removed.

## Conclusion

In this rapid introduction to using MongoDB we looked at:

• What Mongo is
• How to install it
• How to create, find, update and delete records