I have an javascript object as follows. please note the spaces in the string.
find = { search: "name:someName and ( place:someplace or place:someotherplace )" }
i want to convert the string to the following
query={
$and: [
{name:'someName'} ,
{$or: [
{place:'someplace'},
{place:'someotherplace'}
]
}
]
}
I would like generic code which works for any such AND, OR equations and converts them into respective mongoose queries. That is I want a inorder equation to be converted into preorder equation and then modified to get mongoose query.