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

Missing "Not-In" Firestore Query Operator #4060

Closed
metallicgloss opened this issue Jun 4, 2021 · 2 comments
Closed

Missing "Not-In" Firestore Query Operator #4060

metallicgloss opened this issue Jun 4, 2021 · 2 comments
Labels
api: firestore Issues related to the Firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@metallicgloss
Copy link

metallicgloss commented Jun 4, 2021

Is your feature request related to a problem? Please describe.
This request has been created under the "Feature Request" category, but should be considered as "Missing Functionality" and/or a "Bug Report"; there appears to be a limitation with the Google Cloud Firestore PHP library whereby the documented not-in query comparison operator is missing.

Describe the solution you'd like
Ideally, it'd be great to have the missing operator introduced to bring the PHP library in-line and up to date with the global documentation for Firestore. All other operators are usable, and while this problem does have workaround fixes, the fact that the functionality is documented does result in considerable debug time to realise that it is merely the library missing it.

Additional context
The operator is documented in the global documentation here but is not present or usable within the library unlike all other operators (including the newly introduced !=), and as such, returns an error when attempting to be used. The missing operator can be easily seen as being absent from the list of operators found here where only the in variant is included.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 5, 2021
@jdpedrie jdpedrie added api: firestore Issues related to the Firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jun 7, 2021
@jdpedrie
Copy link
Contributor

jdpedrie commented Jun 7, 2021

Hi @metallicgloss,

I'll work on adding the convenience mapping to the Query class, but in the meantime, you can use Not In via the underlying protobuf type, like this:

$collection->where(
    'field',
    \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter\Operator::NOT_IN,
    ["value1", "value2"]
);

@metallicgloss
Copy link
Author

Perfect, thank you @jdpedrie for that pointer! I'll use that as a temporary workaround until you've been able to complete the mapping in the Query class. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the Firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants