import { ... } from 'react-firehooks/firestore';
Returns aggregate of a Firestore Query. Does not update the result once initially calculated.
const [data, loading, error] = useAggregateFromServer(query, aggregateSpec);
Params:
query
: Firestore query the aggregate is calculated foraggregateSpec
: Aggregate specification
Returns:
value
: Aggregate of the Firestore query;undefined
if the aggregate is currently being calculated, or an error occurredloading
:true
while calculating the aggregate;false
if the aggregate was calculated successfully or an error occurrederror
:undefined
if no error occurred
Returns and updates a DocumentSnapshot of a Firestore DocumentReference
const [documentSnap, loading, error] = useDocument(documentReference, options);
Params:
documentReference
: Firestore DocumentReference that will be subscribed tooptions
: Options to configure the subscription
Returns:
value
: DocumentSnapshot;undefined
if document does not exist, is currently being fetched, or an error occurredloading
:true
while fetching the document;false
if the document was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns and updates the data of a Firestore DocumentReference
const [data, loading, error] = useDocumentData(documentReference, options);
Params:
documentReference
: Firestore DocumentReference that will subscribed tooptions
: Options to configure the subscription
Returns:
value
: Document data;undefined
if document does not exist, is currently being fetched, or an error occurredloading
:true
while fetching the document;false
if the document was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns the data of a Firestore DocumentReference
const [documentSnap, loading, error] = useDocumentDataOnce(documentReference, options);
Params:
documentReference
: Firestore DocumentReference that will be fetchedoptions
: Options to configure the document will be fetched
Returns:
value
: Document data;undefined
if document does not exist, is currently being fetched, or an error occurredloading
:true
while fetching the document;false
if the document was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns the DocumentSnapshot of a Firestore DocumentReference. Does not update the DocumentSnapshot once initially fetched
const [querySnap, loading, error] = useDocumentData(documentReference, options);
Params:
documentReference
: Firestore DocumentReference that will be fetchedoptions
: Options to configure how the document will be fetched
Returns:
value
: DocumentSnapshot;undefined
if document does not exist, is currently being fetched, or an error occurredloading
:true
while fetching the document;false
if the document was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns and updates a QuerySnapshot of multiple Firestore queries
const results = useQueries(queries, options);
Params:
queries
: Firestore queries that will be subscribed tooptions
: Options to configure the subscription
Returns:
- Array with tuple for each query:
value
: QuerySnapshot;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns and updates a the document data of multiple Firestore queries
const results = useQueriesData(query, options);
Params:
queries
: Firestore queries that will be subscribed tooptions
: Options to configure the subscription
Returns:
- Array with tuple for each query:
value
: Query data;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns the data of multiple Firestore queries
const results = useQueriesDataOnce(queries, options);
Params:
queries
: Firestore queries that will be fetchedoptions
: Options to configure how the queries are fetched
Returns:
- Array with tuple for each query::
value
: QuerySnapshot;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns the QuerySnapshots of multiple Firestore queries
const results = useQueriesOnce(queries, options);
Params:
queries
: Firestore queries that will be fetchedoptions
: Options to configure how the queries are fetched
Returns:
- Array with tuple for each query::
value
: QuerySnapshot;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns and updates a QuerySnapshot of a Firestore Query
const [querySnap, loading, error] = useQuery(query, options);
Params:
query
: Firestore query that will be subscribed tooptions
: Options to configure the subscription
Returns:
value
: QuerySnapshot;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns and updates a the document data of a Firestore Query
const [data, loading, error] = useQueryData(query, options);
Params:
query
: Firestore query that will be subscribed tooptions
: Options to configure the subscription
Returns:
value
: Query data;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns the data of a Firestore Query. Does not update the data once initially fetched
const [data, loading, error] = useQueryDataOnce(query, options);
Params:
query
: Firestore query that will be fetchedoptions
: Options to configure how the query is fetched
Returns:
value
: Query data;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred
Returns the QuerySnapshot of a Firestore Query. Does not update the QuerySnapshot once initially fetched
const [querySnap, loading, error] = useQueryOnce(query, options);
Params:
query
: Firestore query that will be fetchedoptions
: Options to configure how the query is fetched
Returns:
value
: QuerySnapshot;undefined
if query is currently being fetched, or an error occurredloading
:true
while fetching the query;false
if the query was fetched successfully or an error occurrederror
:undefined
if no error occurred