collection<T> method

RealtimeCollectionReference<T> collection<T>(
  1. String name, {
  2. FromJson<T>? fromJson,
  3. String? idField,
})

Returns a reference to the named collection.

The default idField is _id. You may change it if needed.

The optional fromJson converter is used to map document JSON to strongly typed values when queries are executed.

Implementation

RealtimeCollectionReference<T> collection<T>(
  String name, {
  FromJson<T>? fromJson,
  String? idField,
}) {
  return RealtimeCollectionReference<T>(
    client: this,
    name: name,
    fromJson: fromJson,
    idField: idField,
  );
}