-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[cloud_firestore] Support for map fields in document pagination #1781
[cloud_firestore] Support for map fields in document pagination #1781
Conversation
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! I added the index.
I think it is reasonable to consider this a minor update because developers might want to require this as a minimum version for code that relies on map fields in document pagination.
Am I understanding correctly that Firebase automatically recognizes '.' as a magic field separator and that 'cake.flavor.type' is a thing that you can do today with existing native Firestore SDKs and it will be handled automatically. We're just reimplementing that functionality to try to make pagination work.
I feel like there are some maintainability challenges to our pagination implementation, but I don't see an obvious solution, and I'm ok with merging this in the meantime.
Section 1@collinjackson I tried to create fields that use a Section 2However, as I mentioned, you can store fields with a Section 3
Do you mean that it seems hard to adjust or improve on in the future? Oh, as a side note: An easy empirical proof for the EditI was about to implement what I described in Section 2, however, playing around in the Firebase Console, I found out that calling a field e.g. Illustration: https://i.imgur.com/MLgV8By.mp4 |
Yes, it just feels like there may be unhandled edge cases since we're reimplementing functionality that exists in the native SDKs.
OK, lf it's not supported natively then let's go ahead and merge this as is. Thank you! |
* commit '6b87cc29ef724c5e45f5a47a40263a3f3386bb71': [cloud_firestore] Support for map fields in document pagination (flutter#1781)
Currently, a query with
orderBy('cake.flavor')
will return no documents when using any document pagination method (startAtDocument
etc.).This happens because the internal method, which gets the data from the documents to fill in the
startAt
methods, will try to do something likemap['cake.flavor']
, which will return nothing.It should really be retrieving the field's value using
map['cake']['flavor']
, which this pull request adds.I am not sure about the iOS implementation, however, CI should tell me as I added an integration test (after the index is added).
@collinjackson The query in the integration test requires an index. It would be great if that could be added to test the iOS implementation as well.