createDocument abstract method

TDocument createDocument(
  1. TCollection collection, [
  2. String? id
])

Performs the process of loading a collection.

Usually, you specify a method that can be executed only the first time, such as loadOnce or listen. Retrieves a document from a collection.

By specifying id, you can specify the ID of newly created document. If not specified, uuid will be used.

Implementation

// TCollection listenCollection(TCollection collection);

/// Retrieves a document from a [collection].
///
/// By specifying [id], you can specify the ID of newly created document.
/// If not specified, [uuid] will be used.
TDocument createDocument(TCollection collection, [String? id]);