Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.customers.aggregate([
- {"$match": {"_id": "CUSTOMER-8165f7af-69b4-402d-ae68-b72b86682fb9"}},
- {
- "$lookup": {
- "from": "licenses",
- "let": {"customerId": "$_id"},
- "pipeline": [
- {"$match": {"customerId": "$$customerId"}},
- {"$sort": {"createdAt": 1}},
- ],
- "as": "licenses",
- }
- },
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement