For example, I have such endpoint:
{
'datasource': {
'source': 'project',
'aggregation': {
'pipeline': [
{"$match": "$where"},
{
"$lookup": {
"from": "user",
"localField": "creatorId",
"foreignField": "id",
"as": "creator",
},
},
{'$unwind': '$creator'},
{'$match': "$extraWhere"},
{"$sort": "$order"},
{"$project": "$projection"}
]
}
}
}
Sometimes, I don't have $extraWhere provided. In this case, could eve simply remove this stage from the aggregation pipeline?
For example, I have such endpoint:
Sometimes, I don't have $extraWhere provided. In this case, could eve simply remove this stage from the aggregation pipeline?