Class Collection<T>

Type Parameters

Constructors

  • Type Parameters

    Parameters

    • model: RootModel
    • name: string
    • docClass: typeof Doc

    Returns Collection<T>

Properties

Doc: typeof Doc
docs: DocMap
model: RootModel
name: string
size: number

Methods

  • Adds a document with id and data to this Collection.

    Parameters

    • id: any
    • data: any

    Returns Doc

    doc

  • Returns void

  • Parameters

    • id: any
    • data: any

    Returns Doc

  • Removes the document with id from this Collection. If there are no more documents in the Collection after the given document is removed, then this destroys the Collection.

    Parameters

    • id: string

    Returns void