1

I'm doing a GET request to /objects/items and i want to filter the request on both:

[{ "fieldName": "title", "operator": "equals", "value": "someItem" }]

AND

[{ "fieldName": "description", "operator": "equals", "value": "someDescription" }]

Is this possible? Can only get it to work with one filter. Or any other way you can filter on the two in one api call?

enter image description here

qua1ity
  • 565
  • 2
  • 8
  • 27
  • found the answer: http://stackoverflow.com/questions/36350029/how-can-i-filter-multiple-fields-with-or-in-backand – qua1ity Aug 19 '16 at 15:04

2 Answers2

0

The filter is an array that every item create an AND operator, so all you need is to join the {}, like this:

[{ "fieldName": "title", "operator": "equals", "value": "someItem" },
 { "fieldName": "description", "operator": "equals", "value":"someDescription" }]
Itay
  • 734
  • 4
  • 5
0

You can also use the noSQL syntax in case you need to do OR:

{ "q": { "$or": [ { "title": "someItem" }, { "description": "someDescription" } ] } }

See more examples of advanced filters: http://docs.backand.com/en/latest/apidocs/nosql_query_language/index.html#examples

Itay
  • 734
  • 4
  • 5