PipelineResult

@Beta
class PipelineResult


Represents the results of a Pipeline query, including the data and metadata. It is usually accessed via Pipeline.Snapshot.

Summary

Public functions

open operator Boolean
equals(other: Any?)
Any?
get(field: String)

Retrieves the field specified by field.

Any?
get(fieldPath: FieldPath)

Retrieves the field specified by fieldPath.

Map<StringAny?>

Retrieves all fields in the result as an object map.

String?

Returns the ID of the document represented by this result.

open Int
open String

Public properties

Timestamp?

The time the document was created.

DocumentReference?

The reference to the document, if the query returns the document id for a document.

Timestamp?

The time the document was last updated (at the time the snapshot was generated).

Public functions

equals

open operator fun equals(other: Any?): Boolean

get

fun get(field: String): Any?

Retrieves the field specified by field.

Parameters
field: String

The field path (e.g. "foo" or "foo.bar") to a specific field.

Returns
Any?

The data at the specified field location or null if no such field exists.

get

fun get(fieldPath: FieldPath): Any?

Retrieves the field specified by fieldPath.

Parameters
fieldPath: FieldPath

The field path to a specific field.

Returns
Any?

The data at the specified field location or null if no such field exists.

getData

fun getData(): Map<StringAny?>

Retrieves all fields in the result as an object map.

Returns
Map<StringAny?>

Map of field names to objects.

getId

fun getId(): String?

Returns the ID of the document represented by this result. Returns null if this result is not corresponding to a Firestore document.

Returns
String?

ID of document, if applicable.

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

createTime

val createTimeTimestamp?

The time the document was created. Null if this result is not a document.

ref

val refDocumentReference?

The reference to the document, if the query returns the document id for a document. The name field will be returned by default if querying a document.

Document ids will not be returned if certain pipeline stages omit the document id. For example, Pipeline.select, Pipeline.removeFields and Pipeline.aggregate can omit the document id.

Returns
DocumentReference?

DocumentReference Reference to the document, if applicable.

updateTime

val updateTimeTimestamp?

The time the document was last updated (at the time the snapshot was generated). Null if this result is not a document.