Function createMigrator

  • Creates a migrator that facilitates database migrations. Accepts a custom traverser object as argument which the migrator will use when traversing the collection and writing to documents. This migrator does not use atomic batch writes so it is possible that when a write fails other writes go through.

    Type Parameters

    • D = DocumentData

    Parameters

    • traverser: Traverser<D>

      The traverser object that this migrator will use when traversing the collection and writing to documents.

    Returns DefaultMigrator<D>

    A new DefaultMigrator object.

  • Creates a migrator that facilitates database migrations. The migrator creates a default traverser that it uses when traversing the collection and writing to documents. This migrator does not use atomic batch writes so it is possible that when a write fails other writes go through.

    Type Parameters

    • D = DocumentData

    Parameters

    • traversable: Traversable<D>

      A collection-like traversable group of documents to migrate.

    • Optional traversalConfig: Partial<TraversalConfig>

      Optional. The traversal configuration with which the default traverser will be created.

    Returns DefaultMigrator<D>

    A new DefaultMigrator object.

    Throws

    InvalidConfigError Thrown if the specified traversalConfig is invalid.

Generated using TypeDoc