I have a query which gives the result in single column
{
“collection”: “Orders”,
“aggregate”: [
{
“$project”: {
XYZ : 1,
“source.platform” :1
}
},
{
"$lookup": {
"from": "users",
"localField": "XYZ",
"foreignField": "_id",
"as": "salesRepInfo"
}
},
{
"$project": {
"_id": 0,
"SalesRep Name": "$salesRepInfo.name",
"sourceplatform" : "$payments.source.platform"
}
},
{
"$match": {
"sourceplatform":{"$in":["APP"]}
}
},
{
"$group": {
"_id":{"SalesRep Name":"$SalesRep Name"}
}
}
]
}
I want to use the result of this query in another query as query based dropdown list inside $match operator. first query gives more than 100 outputs, i want to select all in the second query. How can I do that?