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

Firestore: Add support for using snapshot cursors in collection group queries. #8810

Closed

Conversation

IlyaFaer
Copy link

@IlyaFaer IlyaFaer commented Jul 30, 2019

Towards: #8633
I'd propose something like that, though the idea of using snapshot after collection_group() seems wrong to me. As collection_group() includes all collections, which last segment is equal with given collection id, snapshot will be used for different collections, and as exception says it shouldn't be

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 30, 2019
@IlyaFaer IlyaFaer marked this pull request as ready for review July 30, 2019 09:01
@tseaver tseaver changed the title Firestore group collection Firestore: Add support for using snapshot cursors in collection group queries. Jul 30, 2019
@@ -257,7 +257,7 @@ def collection_group(self, collection_id):
)

collection = self.collection(collection_id)
return query.Query(collection, all_descendants=True)
return query.Query(collection, all_descendants=True, is_group=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

all_descendants already implies a collection group query. We shouldn't need is_group.

Copy link
Author

@IlyaFaer IlyaFaer Jul 31, 2019

Choose a reason for hiding this comment

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

I had a guess, but wasn't 100% sure about all_descendants. I propose to rephrase comment in Query:

all_descendants (Optional[bool]):
            When false, selects only collections that are immediate children
            of the `parent` specified in the containing `RunQueryRequest`.
            When true, selects all descendant collections.

In collection_group() comment we can see tip about last segments of collection's path:

Every collection or subcollection with this ID as the last segment of its
        path will be included.

So, I think, query's comment should be alike collection_group's one, 'cause first time I treated it as building down-tree from the specified particular collection

@tseaver tseaver added the api: firestore Issues related to the Firestore API. label Jul 30, 2019
@IlyaFaer IlyaFaer force-pushed the firestore_group_collection branch from 01f4da1 to 3fedc31 Compare July 31, 2019 12:47
Add helper

Add arg to understand, when we're in group

Add requested changes

Nox

Delete argument
@IlyaFaer IlyaFaer force-pushed the firestore_group_collection branch from 50b5292 to 7ab91ba Compare July 31, 2019 13:00
@AVaksman AVaksman added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 31, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 31, 2019
@tseaver
Copy link
Contributor

tseaver commented Aug 1, 2019

Superseded by #8882.

@tseaver tseaver closed this Aug 1, 2019
tseaver added a commit that referenced this pull request Aug 1, 2019
@IlyaFaer IlyaFaer deleted the firestore_group_collection branch September 27, 2019 13:25
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. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants