I am trying to build advance search functionality. I want to convert the input string into mongodb query format.
for example, the input
'status = confirmed AND (assignee = xyz OR priority = low)'
Should be converted to output:
{
and : [{
status : 'confirmed'
}, {
or: [
{assignee: xyz},
{priority: low}
]
}]
}
(assignee = xyz OR (priority = low AND prop = 100))