Suppose I have a collection containing 10000 documents like this:

```
{"_id": 1, "name": "aaa"}
{"_id": 1, "name": "bbb"}
{"_id": 2, "name": "ccc"}
...

```

Now the front end user submits an array containing 100 names, like this:

```
myArray = ["name1", "name2", "name3", "name4", ... "name100"]

```

And he wants to know which of the 100 are not already in the db, so I need to return a new array containing these 100 names minus those that can be found in my collection. How can I do that?

I'm using the official MongoDB driver in Node (npm mongodb).

What I currently do is first find what names ARE in the db by doing db.collection.find({name: {$in: myArray}}), and then exclude the results by javascript. But I imagine there's a better way?

Thanks!