Skip to content

Collection Group Queries #233

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

Merged
merged 10 commits into from
Mar 8, 2019
Merged

Conversation

mikelehen
Copy link
Contributor

@mikelehen mikelehen commented Feb 5, 2019

@mikelehen mikelehen self-assigned this Feb 5, 2019
@googlebot googlebot added cla: yes Override cla labels Feb 5, 2019
@mikelehen
Copy link
Contributor Author

/retest

@mikelehen mikelehen assigned var-const and unassigned mikelehen Feb 5, 2019
@mikelehen mikelehen requested a review from var-const February 5, 2019 19:22
Copy link
Contributor

@var-const var-const left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with small nitpicks. I din't read through the spec test file on the assumption that it's generated from TypeScript code that was reviewed before.

+ methodName
+ "().");
+ "() must result in a valid document path, but '"
+ path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional nit: the wording of this exception is different from the one above, even though they communicate the same thing. Would it be possible to add a helper method like validateDocumentId and move the checks there? Might not be a good idea if it requires too much configurability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these errors are actually redundant. I could get rid of the first one, but I think it will be hit more often, and by handling it separately we can make the error message a little clearer. That said, I did go back and forth on this. I'll think about it a bit more as I do the iOS port.

@@ -1,4 +1,6 @@
# Unreleased
- [feature] You can now query across all collections in your database with a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU, it's only possible to query the most nested collection (e.g., in col1/doc/col2, the only suitable collection is col2). Is it something that should be clear without additional explanation, or should we call it out somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is basically a Firestore-wide subtlety that permeates throughout the API. You can write to col1/doc1/col2/doc2 without col1/doc existing... In which case there isn't a document in "col1" and so doing a collection or collection group query on "col1" won't return anything. But if it DOES exist (because you specifically wrote col1/doc1 at some point), then you can query for "doc1" by doing a collection group query on "col1"

Anyway, I'm inclined to say this is just something people need to be familiar with and not give it extra mention here in the changelog. But if you had some specific callout in mind, let me know. I'm happy to tweak / expand the text here (or in the doc comment on the method).

@var-const var-const assigned mikelehen and unassigned var-const Feb 6, 2019
Copy link
Contributor Author

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the speedy review!

@@ -1,4 +1,6 @@
# Unreleased
- [feature] You can now query across all collections in your database with a
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is basically a Firestore-wide subtlety that permeates throughout the API. You can write to col1/doc1/col2/doc2 without col1/doc existing... In which case there isn't a document in "col1" and so doing a collection or collection group query on "col1" won't return anything. But if it DOES exist (because you specifically wrote col1/doc1 at some point), then you can query for "doc1" by doing a collection group query on "col1"

Anyway, I'm inclined to say this is just something people need to be familiar with and not give it extra mention here in the changelog. But if you had some specific callout in mind, let me know. I'm happy to tweak / expand the text here (or in the doc comment on the method).

+ methodName
+ "().");
+ "() must result in a valid document path, but '"
+ path
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these errors are actually redundant. I could get rid of the first one, but I think it will be hit more often, and by handling it separately we can make the error message a little clearer. That said, I did go back and forth on this. I'll think about it a bit more as I do the iOS port.

@mikelehen
Copy link
Contributor Author

/retest

1 similar comment
@mikelehen
Copy link
Contributor Author

/retest

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 14, 2019

@mikelehen: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests-debug 3fc8914 link /test smoke-tests-debug

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@google-oss-bot
Copy link
Contributor

@mikelehen: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
check-changed 029578b link /test check-changed

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@google-oss-bot
Copy link
Contributor

@mikelehen: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests-release 029578b link /test smoke-tests-release

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@google-oss-bot
Copy link
Contributor

@mikelehen: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests-debug bd88e56 link /test smoke-tests-debug

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@google-oss-bot
Copy link
Contributor

@mikelehen: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests-release bd88e56 link /test smoke-tests-release

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@google-oss-bot
Copy link
Contributor

@mikelehen: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
check-changed bd88e56 link /test check-changed

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mikelehen mikelehen merged commit 0c6acd0 into master Mar 8, 2019
@mikelehen mikelehen deleted the mikelehen/collection-group-queries branch March 8, 2019 21:37
@firebase firebase locked and limited conversation to collaborators Oct 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants