Description
Returns all the documents within a database across different collections and nested levels.
Syntax
Node.js
const
results
=
await
db
.
pipeline
()
.
database
()
.
execute
();
Client examples
Web
// Count all documents in the database const results = await execute ( db . pipeline () . database () . aggregate ( countAll (). as ( "total" )) );
Swift
// Count all documents in the database let results = try await db . pipeline () . database () . aggregate ([ CountAll (). as ( "total" )]) . execute ()
Kotlin
// Count all documents in the database val results = db . pipeline () . database () . aggregate ( AggregateFunction . countAll (). alias ( "total" )) . execute ()
Java
// Count all documents in the database Task<Pipeline . Snapshot > results = db . pipeline () . database () . aggregate ( AggregateFunction . countAll (). alias ( "total" )) . execute ();
Python
from google.cloud.firestore_v1.pipeline_expressions import Count # Count all documents in the database results = client . pipeline () . database () . aggregate ( Count () . as_ ( "total" )) . execute ()
Java
// Count all documents in the database Pipeline . Snapshot results = firestore . pipeline (). database (). aggregate ( countAll (). as ( "total" )). execut (). get (); PipelineSni

