Using the equivalent of in operator in a query for REST API

What is the equivalent of an in operator in a query for REST API using a filter

Here is a sample URL where I filter for the customer number and I want to filter for multiple values

{{url}}/{{company}}/sales/invoices/?filter={"customer.customerNo": "CASH"}

To query this same data in the database I have

select * from customers where cust_no in ('CASH','ABC','123')
LVL 1
GerhardpetAsked:
Who is Participating?
 
GerhardpetAuthor Commented:
I found the answer elsewhere

This is the correct parameter

{"customer.customerNo": { "$in": ["ER118","AAA222"]}}

Open in new window

0
 
Pawan KumarDatabase ExpertCommented:
If you dont want to use IN then you can use OR. This should work in any DB.

select * from customers where
cust_no = 'CASH'   OR  cust_no =  'ABC'  OR cust_no =  '123'
0
 
GerhardpetAuthor Commented:
Please read my question again. You missed my point.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Pawan KumarDatabase ExpertCommented:
Please try like this -

{{url}}/{{company}}/sales/invoices/?filter=("customer.customerNo": "CASH") OR ("customer.customerNo": "ABC")  OR ("customer.customerNo": "123")

You can read more from - https://sharepoint.stackexchange.com/questions/163307/rest-api-filter-multiple-values
0
 
GerhardpetAuthor Commented:
That does not work for REST API. Do you have experience using the REST API?
0
 
GerhardpetAuthor Commented:
I found the answer elsewhere
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.