react-admin-firebase
react-admin-firebase copied to clipboard
Improve GetList query
This is a suggestion around the GetList query.
Since the firebase SDK has native support counting documents within a collection, we can use this aggregation query to replace some parts of the existing functionality.
Currently, we make a call to firestore, retrieve the whole list of documents, and then manually filter and count any documents. Rather than calling firebase requesting all the documents within the collection, we can make a call that retrieve only the documents we need, and then count all the documents within the collection using the aggregation query. We can use the orderBy and limit methods available from the firebase sdk in order to apply in filtering and sorting.
Very interesting, I wasn't aware of this new feature, it would greatly improve the LazyLoading function in this project.
Feel free to make a PR if you have time
I will do, most likely in a couple of weeks.
I will do, most likely in a couple of weeks.
Interested in the outcome - willing to help if needed.