-
Notifications
You must be signed in to change notification settings - Fork 626
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
Conversation
/retest |
There was a problem hiding this 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.
firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/core/Query.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/Query.java
Outdated
Show resolved
Hide resolved
+ methodName | ||
+ "()."); | ||
+ "() must result in a valid document path, but '" | ||
+ path |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/IndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java
Show resolved
Hide resolved
firebase-firestore/CHANGELOG.md
Outdated
@@ -1,4 +1,6 @@ | |||
# Unreleased | |||
- [feature] You can now query across all collections in your database with a |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
There was a problem hiding this 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!
firebase-firestore/CHANGELOG.md
Outdated
@@ -1,4 +1,6 @@ | |||
# Unreleased | |||
- [feature] You can now query across all collections in your database with a |
There was a problem hiding this comment.
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).
firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/Query.java
Outdated
Show resolved
Hide resolved
+ methodName | ||
+ "()."); | ||
+ "() must result in a valid document path, but '" | ||
+ path |
There was a problem hiding this comment.
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.
firebase-firestore/src/main/java/com/google/firebase/firestore/local/MemoryIndexManager.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/MemoryIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java
Show resolved
Hide resolved
/retest |
1 similar comment
/retest |
@mikelehen: The following test failed, say
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: The following test failed, say
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: The following test failed, say
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: The following test failed, say
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: The following test failed, say
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: The following test failed, say
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. |
Port of firebase/firebase-js-sdk#1440