The `$in` operator in MongoDB is used to match values within a specified array in the query. You can use the `$in` operator in conditions to get results that match any value in a specified array.
Here is the basic syntax of using `$in` operator in MongoDB:
```
db.collection.find({field: {$in: [
```
Here, replace `db.collection` with the name of your database and collection, `field` with the name of the field on which you want to match the values and replace `
For example, if you have a `users` collection and you want to find all users who live in either “New York” or “Los Angeles”, you could use the `$in` operator like this:
```
db.users.find( { “address.city”: { $in: [ “New York”, “Los Angeles” ] } } );
```
Similarly, if you have a `products` collection and you want to find all products that cost either $20 or $50, you could use the `$in` operator like this:
```
db.products.find( { “price”: { $in: [ 20, 50] } } );
```