GoogleCloudPlatform / php-docs-samples

A collection of samples that demonstrate how to call Google Cloud services from PHP.
http://cloud.google.com/php
Apache License 2.0
957 stars 1.03k forks source link

Are Firestore aggregation queries supported? (count, sum etc) #1955

Closed giorgio79 closed 7 months ago

giorgio79 commented 8 months ago

Are aggregation queries supported? :) ChatGPT said this php library does not :P

https://firebase.google.com/docs/firestore/query-data/aggregation-queries#dart

shivgautam commented 8 months ago

It is available and was released on Dec 1. https://github.com/googleapis/google-cloud-php/pull/6786

giorgio79 commented 8 months ago

Much appreciated! Could we get some php samples pls here? https://firebase.google.com/docs/firestore/query-data/aggregation-queries

shivgautam commented 7 months ago

Yes. We are discussing it internally. Will be working on it. Can't provide an ETA at the moment though.

giorgio79 commented 7 months ago

Found a sample in the comment here https://github.com/googleapis/google-cloud-php/blob/main/Firestore/src/AggregateQuery.php but I am getting 0 in my own tests. Will wait for sg official on that page :P

` * Example:

shivgautam commented 7 months ago

Here are a few examples to get you started in the meantime: https://github.com/googleapis/google-cloud-php/blob/main/Firestore/src/Aggregate.php#L66-L116