Answers for "Filter inside add field mongoDB"

0

Filter inside add field mongoDB

> db.demo118.aggregate([
...    {
...       "$addFields": {
...          "Details": {
...             "$filter": {
...                "input": "$Details",
...                "as": "out",
...                "cond": { "$in": ["$$out.S", "$Subjects"] }
...             }
...          }
...       }
...    }
... ]).pretty();
Posted by: Guest on October-22-2021

Browse Popular Code Answers by Language