The deleteMany method

Now, we're going to start off with deleteMany, and we're going to target those duplicates we just created. The goal in this section, is to delete every single Todo inside of the Todos collection that has a text property equal to Eat lunch. Currently, there are three out of five that fit that criteria.

In Atom, we can go ahead and kick things off by doing db.collection. This is going to let us target our Todos collection. Now, we can go ahead and use the collection method deleteMany, passing in the arguments. In this case, the only argument we need is our object, and this object is just like the object we passed to find. With this, we can target our Todos. In this case, we're going to delete every Todo where the text ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.