MongoDB: Query nested array from document

db.collection.aggregate([
  {
    $match: { "coding.system": "ABC" }
  },
  {
    $unwind: "$coding"
  },
  {
    $match: { "coding.system": "ABC" }
  },
  {
    $project: { code: "$coding.code" }
  }
])
Topics: MongoDB

Related Code Examples