Skip to content

Instantly share code, notes, and snippets.

db.getCollection('product').aggregate([
{$match: {"productItems.id": 23456}},
{$unwind: "$productItems"},
{$match: {"productItems.id": 23456}},
{
$lookup:
{
from: "options",
localField: "productItems.id",
foreignField: "pid",