Im receiving a set of filters as a composed object in my express server. In order to create the query I came to the conclusion of splitting each object route into a separate array of keys.
Example:
$and: {
age: [21, 22],
name: {
$like: "Alice"
}
}
What I want:
[$and,age,[21, 22]]
[$and,name,$like,"Alice"]
Any clue in solving this problem would be much appreciated.