Search⌘ K
AI Features

Write Query: Reading Arrays

The task involves querying a products collection to identify items with tags related to USB connectivity for a marketing campaign. The goal is to extract the name, category, and tags of products whose tags array includes variations of "usb," such as "usb-3.0" or "usb-c." This requires utilizing MongoDB's querying capabilities to filter documents based on the specified criteria within the tags array.

We'll cover the following...

Question

Given the following sample documents from the products collection:

[
  {
    "_id": "a101a9c0c1f9472db1c01a11",
    "name": "Laptop",
    "category":
...
...