Open swftvsn opened 6 years ago
This isn't currently supported in Firestore. You can get away with more via more flexible querying in Firestore, but there's definitely use cases that aren't covered there.
I'll see if I can get this into the next release. cc @samtstern
Is there a workaround for reversing firestore results on the client similar to #436?
You can use order(by:)
on Firestore's Query
type to sort the results the query returns. It's not a great workaround and sometimes means adding data for the sake of sorting.
That works, but I can’t figure out how to combine order and limit to produce a reversed feed. For example, this is useful in a chat interface, where I want to render the 30 latest messages, newest on bottom.
It would be helpful if the data source had an option to reverse the data source.
Ah ok I know what you're asking about. In Realtime Database we called this "limitToLast()" and it's definitely something we are missing in Cloud Firestore! We've discussed adding this, but you're right it's awkward right now.
On Wed, Aug 8, 2018 at 12:50 PM Mickey Reiss notifications@github.com wrote:
That works, but I can’t figure out how to combine order and limit to produce a reversed feed. For example, this is useful in a chat interface, where I want to render the 30 latest messages, newest on bottom.
It would be helpful if the data source had an option to reverse the data source.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/FirebaseUI-iOS/issues/491#issuecomment-411530327, or mute the thread https://github.com/notifications/unsubscribe-auth/AIEw6uKMQJOQ9TF-zlYcH5Svsr04cYgrks5uO0EDgaJpZM4VlZpB .
@samtstern Anything to share on plans for this feature? We are currently using a wrapper library called Pring which adds support for this.
I wrote a drop-in replacement in Swift for FUIBatchedArray and FUIFirestoreCollectionViewDataSource that supports filtering if anybody needs that functionality right now. I want to implement map as well, but I'm not quite sure how to or if I should modify a DocumentSnapshot.
Hi!
I saw that this is supported in Realtime Database (#183) and was wondering if there is any documentation available how to use this in Firestore applications?
Any help and pointers are appreciated, thanks!