Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where in list #70

Closed
solokhind opened this issue Dec 22, 2020 · 9 comments
Closed

Where in list #70

solokhind opened this issue Dec 22, 2020 · 9 comments

Comments

@solokhind
Copy link

As of OData 4.01, the in statement is supported.

Here is the example from their documentation:

Example 56: all products whose name value is ‘Milk’ or ‘Cheese’:

https://host/service/Products?$filter=Name in ('Milk', 'Cheese')

https://docs.oasis-open.org/odata/odata/v4.01/csprd02/part2-url-conventions/odata-v4.01-csprd02-part2-url-conventions.html#_Toc486261685

Is there a functionality for this in this library? Thank you

@anderly
Copy link
Member

anderly commented Jan 13, 2021

Have you tried $client->where("Field", "contains", "foo")?

@solokhind
Copy link
Author

This is a little different, I'm not trying to see if "field" contains "foo". I'm trying to see if "field" value exists in list. In the OData example, you're checking to see if Name equals "Milk" or "Cheese".

I know I can use the orWhere method for this, but it is inefficient.

@anderly
Copy link
Member

anderly commented Jul 1, 2021

@ds620107,

I see. I'm going to see if we can get this implemented using a whereIn() method similar to Laravel query builder whereIn method.

Signature would be like $client->whereIn('Name', ['Milk','Cheese'])

Let me know if that would achieve what you're looking for.

@solokhind
Copy link
Author

Yes, that would work. Thanks!

@joey-carlisle4
Copy link

any update?

@shaedrich
Copy link

I'd need that, too. So, I'm looking forward to it being implemented

@n8rowley
Copy link
Contributor

n8rowley commented Aug 4, 2023

I'd like to add my voice to those hoping this is still coming

@anderly
Copy link
Member

anderly commented Jul 31, 2024

Closed by #117

@anderly anderly closed this as completed Jul 31, 2024
@anderly
Copy link
Member

anderly commented Jul 31, 2024

See tests here for example usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants