Do fireO only supports count and not other aggregation like sum, avg?
Here's example code using firestore library:
`
from google.cloud import firestore
from google.cloud.firestore_v1 import aggregation
from google.cloud.firestore_v1.base_query import FieldFilter
def create_count_query(project_id: str) -> None:
client = firestore.Client(project=project_id)
collection_ref = client.collection("users")
query = collection_ref.where(filter=FieldFilter("born", ">", 1800))
aggregate_query = aggregation.AggregationQuery(query)
# `alias` to provides a key for accessing the aggregate query results
aggregate_query.count(alias="all")
results = aggregate_query.get()
for result in results:
print(f"Alias of results from query: {result[0].alias}")
print(f"Number of results from query: {result[0].value}")
`
I want to do the samething using the fireO library. Is it possible?
Thank you.
Do fireO only supports count and not other aggregation like sum, avg?
Here's example code using firestore library:
`
from google.cloud import firestore
from google.cloud.firestore_v1 import aggregation
from google.cloud.firestore_v1.base_query import FieldFilter
def create_count_query(project_id: str) -> None:
`
I want to do the samething using the fireO library. Is it possible?
Thank you.