I am trying to create this output
{ "$and": [ { "type": "Nanoheal" }, { "$or": [ { "specialFields.address": "Jaysingpur" }, { "specialFields.email": "prathameshmore@gmail.com" } ] } ] }
It's working when I am using a string like this
let operands = query.split("'").filter(Boolean); //Output [ '(', '"type": "Nanoheal"', 'AND', '(', '"specialFields.email": "prathameshmore@nanoheal"', 'OR', '"specialFields.address": "Jaysingpur"', ')', ')' ]
const query = `'('"type": "Nanoheal"'AND'('"specialFields.email": "prathameshmore@nanoheal"'OR'"specialFields.address": "Jaysingpur"')'')'`;
I want to make the query simple from the user side.
("type": "Person" AND ("specialFields.email": "prathameshmore@gmail.com" OR "specialFields.address": "Jaysingpur"))
The stack is used to create this object
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am trying to create this output
It's working when I am using a string like this
I want to make the query simple from the user side.
("type": "Person" AND ("specialFields.email": "prathameshmore@gmail.com" OR "specialFields.address": "Jaysingpur"))
The stack is used to create this object