I'm building my own queries with the npm mongo-query-generator and I have quotes within the conditions. Is there any way to remove those quotes so I can apply regex properly?
What I currently have:
db.getCollection('products').find(
{"$and":
[{"$or": [
{"category": "/cteos/i"},
{"category": "/especiales/i"} ]}
,{"category": "/huevos/i"}
]})
What I want:
db.getCollection('products').find(
{"$and":
[{"$or": [
{"category": /cteos/i},
{"category": /especiales/i} ]}
,{"category": /huevos/i}
]})