FirestoreKt
public final class FirestoreKt
Summary
Public fields |
|
---|---|
final @NonNull FirebaseFirestore |
Returns the |
Public methods |
|
---|---|
static final @NonNull Flow<T> |
<T extends Object> FirestoreKt.dataObjects( Starts listening to the document referenced by this |
static final @NonNull Flow<@NonNull List<@NonNull T>> |
<T extends Object> FirestoreKt.dataObjects( Starts listening to this query with the given options and emits its values converted to a POJO via a |
static final @NonNull FirebaseFirestore |
FirestoreKt.firestore( Returns the |
static final @NonNull FirebaseFirestore |
Returns the |
static final @NonNull FirebaseFirestore |
FirestoreKt.firestore( Returns the |
static final @NonNull FirebaseFirestoreSettings |
firestoreSettings( Returns a |
static final T |
<T extends Object> FirestoreKt.getField( Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist. |
static final T |
<T extends Object> FirestoreKt.getField( Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist. |
static final T |
<T extends Object> FirestoreKt.getField( Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist. |
static final T |
<T extends Object> FirestoreKt.getField( Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist. |
static final @NonNull MemoryCacheSettings |
memoryCacheSettings( |
static final @NonNull MemoryEagerGcSettings |
memoryEagerGcSettings( |
static final @NonNull MemoryLruGcSettings |
memoryLruGcSettings( |
static final @NonNull PersistentCacheSettings |
persistentCacheSettings( |
static final @NonNull Flow<@NonNull DocumentSnapshot> |
FirestoreKt.snapshots( Starts listening to the document referenced by this |
static final @NonNull Flow<@NonNull QuerySnapshot> |
FirestoreKt.snapshots( Starts listening to this query with the given options and emits its values via a |
static final T |
<T extends Object> FirestoreKt.toObject(@NonNull DocumentSnapshot receiver) Returns the contents of the document converted to a POJO or null if the document doesn't exist. |
static final @NonNull T |
<T extends Object> FirestoreKt.toObject(@NonNull QueryDocumentSnapshot receiver) Returns the contents of the document converted to a POJO. |
static final T |
<T extends Object> FirestoreKt.toObject( Returns the contents of the document converted to a POJO or null if the document doesn't exist. |
static final @NonNull T |
<T extends Object> FirestoreKt.toObject( Returns the contents of the document converted to a POJO. |
static final @NonNull List<@NonNull T> |
<T extends Object> FirestoreKt.toObjects(@NonNull QuerySnapshot receiver) Returns the contents of the documents in the QuerySnapshot, converted to the provided class, as a list. |
static final @NonNull List<@NonNull T> |
<T extends Object> FirestoreKt.toObjects( Returns the contents of the documents in the QuerySnapshot, converted to the provided class, as a list. |
Public fields
firestore
public final @NonNull FirebaseFirestore firestore
Returns the FirebaseFirestore
instance of the default FirebaseApp
.
Public methods
FirestoreKt.dataObjects
public static final @NonNull Flow<T> <T extends Object> FirestoreKt.dataObjects(
@NonNull DocumentReference receiver,
@NonNull MetadataChanges metadataChanges
)
Starts listening to the document referenced by this DocumentReference
with the given options and emits its values converted to a POJO via a Flow
.
-
When the returned flow starts being collected, an
EventListener
will be attached. -
When the flow completes, the listener will be removed.
Parameters | |
---|---|
<T extends Object> |
The type of the object to convert to. |
@NonNull MetadataChanges metadataChanges |
controls metadata-only changes. Default: |
FirestoreKt.dataObjects
public static final @NonNull Flow<@NonNull List<@NonNull T>> <T extends Object> FirestoreKt.dataObjects(
@NonNull Query receiver,
@NonNull MetadataChanges metadataChanges
)
Starts listening to this query with the given options and emits its values converted to a POJO via a Flow
.
-
When the returned flow starts being collected, an
EventListener
will be attached. -
When the flow completes, the listener will be removed.
Parameters | |
---|---|
<T extends Object> |
The type of the object to convert to. |
@NonNull MetadataChanges metadataChanges |
controls metadata-only changes. Default: |
FirestoreKt.firestore
public static final @NonNull FirebaseFirestore FirestoreKt.firestore(
@NonNull Firebase receiver,
@NonNull FirebaseApp app
)
Returns the FirebaseFirestore
instance of a given FirebaseApp
.
FirestoreKt.firestore
public static final @NonNull FirebaseFirestore FirestoreKt.firestore(
@NonNull Firebase receiver,
@NonNull String database
)
Returns the FirebaseFirestore
instance of the default FirebaseApp
, given the database name.
FirestoreKt.firestore
public static final @NonNull FirebaseFirestore FirestoreKt.firestore(
@NonNull Firebase receiver,
@NonNull FirebaseApp app,
@NonNull String database
)
Returns the FirebaseFirestore
instance of a given FirebaseApp
and database name.
firestoreSettings
public static final @NonNull FirebaseFirestoreSettings firestoreSettings(
@ExtensionFunctionType @NonNull Function1<@NonNull FirebaseFirestoreSettings.Builder, Unit> init
)
Returns a FirebaseFirestoreSettings
instance initialized using the init
function.
FirestoreKt.getField
public static final T <T extends Object> FirestoreKt.getField(
@NonNull DocumentSnapshot receiver,
@NonNull String field
)
Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist.
Parameters | |
---|---|
<T extends Object> |
The type to convert the field value to. |
@NonNull String field |
The path to the field. |
Returns | |
---|---|
T |
The value at the given field or null. |
FirestoreKt.getField
public static final T <T extends Object> FirestoreKt.getField(
@NonNull DocumentSnapshot receiver,
@NonNull FieldPath fieldPath
)
Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist.
Parameters | |
---|---|
<T extends Object> |
The type to convert the field value to. |
@NonNull FieldPath fieldPath |
The path to the field. |
Returns | |
---|---|
T |
The value at the given field or null. |
FirestoreKt.getField
public static final T <T extends Object> FirestoreKt.getField(
@NonNull DocumentSnapshot receiver,
@NonNull String field,
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior
)
Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist.
Parameters | |
---|---|
<T extends Object> |
The type to convert the field value to. |
@NonNull String field |
The path to the field. |
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior |
Configures the behavior for server timestamps that have not yet been set to their final value. The value at the given field or null. |
FirestoreKt.getField
public static final T <T extends Object> FirestoreKt.getField(
@NonNull DocumentSnapshot receiver,
@NonNull FieldPath fieldPath,
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior
)
Returns the value at the field, converted to a POJO, or null if the field or document doesn't exist.
Parameters | |
---|---|
<T extends Object> |
The type to convert the field value to. |
@NonNull FieldPath fieldPath |
The path to the field. |
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior |
Configures the behavior for server timestamps that have not yet been set to their final value. The value at the given field or null. |
memoryCacheSettings
public static final @NonNull MemoryCacheSettings memoryCacheSettings(
@ExtensionFunctionType @NonNull Function1<@NonNull MemoryCacheSettings.Builder, Unit> init
)
memoryEagerGcSettings
public static final @NonNull MemoryEagerGcSettings memoryEagerGcSettings(
@ExtensionFunctionType @NonNull Function1<@NonNull MemoryEagerGcSettings.Builder, Unit> init
)
memoryLruGcSettings
public static final @NonNull MemoryLruGcSettings memoryLruGcSettings(
@ExtensionFunctionType @NonNull Function1<@NonNull MemoryLruGcSettings.Builder, Unit> init
)
persistentCacheSettings
public static final @NonNull PersistentCacheSettings persistentCacheSettings(
@ExtensionFunctionType @NonNull Function1<@NonNull PersistentCacheSettings.Builder, Unit> init
)
FirestoreKt.snapshots
public static final @NonNull Flow<@NonNull DocumentSnapshot> FirestoreKt.snapshots(
@NonNull DocumentReference receiver,
@NonNull MetadataChanges metadataChanges
)
Starts listening to the document referenced by this DocumentReference
with the given options and emits its values via a Flow
.
-
When the returned flow starts being collected, an
EventListener
will be attached. -
When the flow completes, the listener will be removed.
Parameters | |
---|---|
@NonNull MetadataChanges metadataChanges |
controls metadata-only changes. Default: |
FirestoreKt.snapshots
public static final @NonNull Flow<@NonNull QuerySnapshot> FirestoreKt.snapshots(
@NonNull Query receiver,
@NonNull MetadataChanges metadataChanges
)
Starts listening to this query with the given options and emits its values via a Flow
.
-
When the returned flow starts being collected, an
EventListener
will be attached. -
When the flow completes, the listener will be removed.
Parameters | |
---|---|
@NonNull MetadataChanges metadataChanges |
controls metadata-only changes. Default: |
FirestoreKt.toObject
public static final T <T extends Object> FirestoreKt.toObject(@NonNull DocumentSnapshot receiver)
Returns the contents of the document converted to a POJO or null if the document doesn't exist.
Parameters | |
---|---|
<T extends Object> |
The type of the object to create. |
Returns | |
---|---|
T |
The contents of the document in an object of type T or null if the document doesn't exist. |
FirestoreKt.toObject
public static final @NonNull T <T extends Object> FirestoreKt.toObject(@NonNull QueryDocumentSnapshot receiver)
Returns the contents of the document converted to a POJO.
Parameters | |
---|---|
<T extends Object> |
The type of the object to create. |
Returns | |
---|---|
@NonNull T |
The contents of the document in an object of type T. |
FirestoreKt.toObject
public static final T <T extends Object> FirestoreKt.toObject(
@NonNull DocumentSnapshot receiver,
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior
)
Returns the contents of the document converted to a POJO or null if the document doesn't exist.
Parameters | |
---|---|
<T extends Object> |
The type of the object to create. |
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior |
Configures the behavior for server timestamps that have not yet been set to their final value. The contents of the document in an object of type T or null if the document doesn't exist. |
FirestoreKt.toObject
public static final @NonNull T <T extends Object> FirestoreKt.toObject(
@NonNull QueryDocumentSnapshot receiver,
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior
)
Returns the contents of the document converted to a POJO.
Parameters | |
---|---|
<T extends Object> |
The type of the object to create. |
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior |
Configures the behavior for server timestamps that have not yet been set to their final value. The contents of the document in an object of type T. |
FirestoreKt.toObjects
public static final @NonNull List<@NonNull T> <T extends Object> FirestoreKt.toObjects(@NonNull QuerySnapshot receiver)
Returns the contents of the documents in the QuerySnapshot, converted to the provided class, as a list.
Parameters | |
---|---|
<T extends Object> |
The POJO type used to convert the documents in the list. |
FirestoreKt.toObjects
public static final @NonNull List<@NonNull T> <T extends Object> FirestoreKt.toObjects(
@NonNull QuerySnapshot receiver,
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior
)
Returns the contents of the documents in the QuerySnapshot, converted to the provided class, as a list.
Parameters | |
---|---|
<T extends Object> |
The POJO type used to convert the documents in the list. |
@NonNull DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior |
Configures the behavior for server timestamps that have not yet been set to their final value. |