PipelineResult

@Beta
public final class PipelineResult


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

Summary

Public fields

final Timestamp

The time the document was created.

final DocumentReference

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

final Timestamp

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

Public methods

boolean
equals(Object other)
final Object
get(@NonNull String field)

Retrieves the field specified by field.

final Object
get(@NonNull FieldPath fieldPath)

Retrieves the field specified by fieldPath.

final @NonNull Map<@NonNull StringObject>

Retrieves all fields in the result as an object map.

final String

Returns the ID of the document represented by this result.

int
@NonNull String

Public fields

createTime

public final Timestamp createTime

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

ref

public final DocumentReference ref

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

public final Timestamp updateTime

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

Public methods

equals

public boolean equals(Object other)

get

public final Object get(@NonNull String field)

Retrieves the field specified by field.

Parameters
@NonNull String field

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

Returns
Object

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

get

public final Object get(@NonNull FieldPath fieldPath)

Retrieves the field specified by fieldPath.

Parameters
@NonNull FieldPath fieldPath

The field path to a specific field.

Returns
Object

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

getData

public final @NonNull Map<@NonNull StringObjectgetData()

Retrieves all fields in the result as an object map.

Returns
@NonNull Map<@NonNull StringObject>

Map of field names to objects.

getId

public final String getId()

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

public int hashCode()

toString

public @NonNull String toString()