Solution: Using Regular Expressions
We'll cover the following...
Query
db.customers.find({email: { $regex: /@gmail\.com$/i },ordersCount: { $gte: 3 }},{name: 1,email: 1,ordersCount: 1,_id: 0})
Explanation
The explanation of the query is given below:
Line 1: Start querying the
customerscollection using thefind()method. ...