Skip to content

DocumentSnapshot

A local copy of a document read from a CAWS collection. The maps are mutable, but changing them does not update the server.

Returned by DocumentReference.get, DocumentReference.setData, CollectionReference.documents and the document queries on CarpService. The data can be extracted with the data property or by using subscript syntax to access a specific field.

Properties

collectionId

int get collectionId

The id of the collection this document belongs to

collections

List<String?> get collections

The names of the collections nested inside this document.

createdAt

DateTime get createdAt

The timestamp of creation of this document

createdByUserId

String get createdByUserId

The id of the user who created this document

data

Map<String, dynamic> get data

Contains all the data of this snapshot. Empty if the document has no data.

id

int get id

The ID of the snapshot's document

name

String get name

The name of the snapshot's document

path

String get path

The full path to this document

snapshot

Map<String, dynamic> get snapshot

The full data snapshot

updatedAt

DateTime get updatedAt

The timestamp of latest update of this document

Methods

toString

String toString()
override

Returns true if the document exists.

Operators

operator []

dynamic operator [](
  1. String key
)

Reads individual data values from the snapshot