mahmoudtrageh's avatar

how can i get count of document in firebase laravel

-query: Google\Cloud\Firestore\Query {#818 ▶}

this rows -> how can if get its count ?

-rows: array:30 [▶]

0 likes
1 reply
bobbybouwmann's avatar

Well, rows is an array, right? You can use count($rows) to get the count here.

This might not work, because firebase returns a generator. So you can basically only get the count by looping over all the items. So still get the count you can use iterator_count($rows) instead.

4 likes

Please or to participate in this conversation.