toJson method

Map<String, Object?> toJson()

Returns a JSON-serializable representation of this snapshot, which QuerySnapshot.fromJson reads back and FirebaseFirestore.querySnapshotsFromJson listens from.

The bundle field holds the query and its documents as a Firestore bundle, with the query under the name in bundleName. Throws a FirestoreException (failed-precondition) if the snapshot has pending writes: await waitForPendingWrites() first.

This is the JS SDK QuerySnapshot.toJSON(); the JSON is interchangeable with the one of the JS SDK (Node).

Implementation

Map<String, Object?> toJson() =>
    snapshot_json.querySnapshotToJson(_firestore, snapshot);