Search⌘ K
AI Features

Write Query: Using Regular Expressions

To identify premium customers for a marketing campaign, a query can be constructed to filter documents from the customers collection. The criteria include customers who have placed three or more orders and possess a Gmail address. The output should display the names, emails, and order counts of these customers, ensuring that only those meeting both conditions are included.

We'll cover the following...

Question

Given the following sample documents from the customers collection:

[
  {
    "_id": "ee3c04494293e51a48af88d1",
    "name": "Michael Carter",
    "email": "michael.carter@gmail.com",
    "phone": "+1-206-555-0142",
    "address": {
      "street": "1206 Pine St",
      "city": "Seattle",
      "state": "WA",
      "postalCode": "98101",
      "country": "US"
    },
   
...