daniel goshen
Posts: 0
Joined: Sun Jul 20, 2014 6:48 am

How to implement a contains query

I am trying to place a "
contains query" in my data services query. When debugging I see that the correct value is being passed or captured, but I am not constructing the query correctly.

When I click the "add JS" button for the "where" clause, I add the following: return '{"color_number": "'+value+'"}'; I have tried various on this including return '{"color_number": {"$in":["'+value+'"]}}';but can't seem to get it to working. Any assistance would be appreciated.

daniel goshen
Posts: 0
Joined: Sun Jul 20, 2014 6:48 am

How to implement a contains query

Am I going about this the correct way?. As the questions before and after mine have been I addressed - I wanted to see if I am missing/overlooking something.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How to implement a contains query

Hi Daniel,

Please clarify as it's not clear what you are trying to do, you saying that you see that the correct value is being passed - where do you see this?

Also please show the structure of your mapping as its not clear how you are adding "add JS" to the "where" clause.

daniel goshen
Posts: 0
Joined: Sun Jul 20, 2014 6:48 am

How to implement a contains query

Hi Illya Sorry. I was not sure how much detail to provide. Let me pull a few images together.

daniel goshen
Posts: 0
Joined: Sun Jul 20, 2014 6:48 am

How to implement a contains query

I have created a page with the images showing what I have done lfwebz.biz/apq/mood.html

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to implement a contains query

Hi Daniel,

Could you please clarify whether color_number is an array of numbers or strings? If numbers, try the following:pre return '{"color_number": {"$in":['+value+']}}';/pre

daniel goshen
Posts: 0
Joined: Sun Jul 20, 2014 6:48 am

How to implement a contains query

Goodness, thanks so much - that got it working.

Return to “Issues”