I am designing a report filter, and attempting to establish the best way to allow the user to filter the results returned to them, via a form on the front end in angular. The user should be able to create multiple filter conditions, including stringing filters together with and/or type logic. I am using MongoDB. An example of the query code on the client side looks like this:
$match: {
$expr: {
$or :[
{ $and: [
{ $eq: ["$$phaseId", "123409876"] },
{ $eq: ["$$taskId", "987654387"] },
]},
{ $eq: ["$$projectId", "123456789"] }
]
}
I need help understanding the correct way to send such query information from my front end to the server. I have attempted to use query params, but the nesting seems too complex, and I need help figuring out a good way to string together multiple queries with and/or logic.
Can anyone point me in the right direction? Any guidance would be greatly appreciated.