react-admin-firebase icon indicating copy to clipboard operation
react-admin-firebase copied to clipboard

Improve GetList query

Open MarioSimou opened this issue 2 years ago • 3 comments

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.

MarioSimou avatar Jan 14 '23 22:01 MarioSimou

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

benwinding avatar Jan 15 '23 22:01 benwinding

I will do, most likely in a couple of weeks.

MarioSimou avatar Jan 17 '23 15:01 MarioSimou

I will do, most likely in a couple of weeks.

Interested in the outcome - willing to help if needed.

murat0 avatar Jul 17 '23 17:07 murat0