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

Support Query.WhereIn(field, array-of-arrays) #5007

Closed
jskeet opened this issue Jun 1, 2020 · 1 comment
Closed

Support Query.WhereIn(field, array-of-arrays) #5007

jskeet opened this issue Jun 1, 2020 · 1 comment
Assignees
Labels
api: firestore Issues related to the Firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@jskeet
Copy link
Collaborator

jskeet commented Jun 1, 2020

Currently trying to write a sample, and this query fails:

Query query = citiesRef.WhereIn("Regions",
    new[] { new[] { "west_coast" }, new[] { "east_coast" } });

Error:

System.ArgumentException: Array values cannot directly contain other array values

@jskeet jskeet added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: firestore Issues related to the Firestore API. labels Jun 1, 2020
@jskeet jskeet self-assigned this Jun 1, 2020
@jskeet
Copy link
Collaborator Author

jskeet commented Jun 1, 2020

(It may be worth trying to address #4981 and this at the same time.)

jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Jun 2, 2020
…side validation

While nested arrays aren't allowed in documents, they are allowed for Where-In queries, where the query needs to express "the value of the field should be one of these arrays".
In an ideal world we'd only permit that for the query rather than document construction, but that's relatively hard to weave through the code... whereas just allowing it client-side and then preventing it server-side is simple.
Note that clients can already construct nested arrays by creating their own Value objects, so the server-side validation is required there anyway.

Fixes googleapis#5007.
@jskeet jskeet closed this as completed in 48cef0e Jun 2, 2020
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

1 participant