Makoto
Posts: 0
Joined: Fri Oct 10, 2014 8:15 am

Query constraint using $or and slash(/)

Hi,

I’d like to add search function to my app. And, I’m going to input the following JavaScript in a Mapping action editor.

return '{"$or": [{“header”:”’+value+'"},{"body": "'+value+'"}]}';

It's okay, but I want to add "slash" to the code in order to widen the search range. But, I don’t know how. Would you help me? Thank you.

I’ve already checked here↓

https://devcenter.appery.io/documenta...

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Query constraint using $or and slash(/)

Hello,

I am sorry, not sure I understand you correctly. What does "slash" in the query mean? Please specify your question.

Makoto
Posts: 0
Joined: Fri Oct 10, 2014 8:15 am

Query constraint using $or and slash(/)

Hi Sergiy,

Thank you for your quick reply.
What I want to do is to add “partial word matching” feature.

I’m checking the following site, and I think “slash” makes it possible to add the feature.
Is this wrong?

http://docs.mongodb.org/manual/refere...

Makoto
Posts: 0
Joined: Fri Oct 10, 2014 8:15 am

Query constraint using $or and slash(/)

I could solve my own question. The following code works fine exactly as I expected.
Thank you.

return '{"$or": [{"header": {"$regex":"'+value+'", "$options": "i"}},{"body": {"$regex":"'+value+'", "$options": "i"}}]}';

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Query constraint using $or and slash(/)

Thank you for update. Great job!

Return to “Issues”