Skip to main content
Version: 6.4

MongoSchemaGenerator

Hierarchy

Index

Constructors

constructor

Methods

inheritedclearDatabase

  • Parameters

    Returns Promise<void>

inheritedcreateDatabase

  • createDatabase(name?: string): Promise<void>
  • creates new database and connects to it


    Parameters

    • optionalname: string

    Returns Promise<void>

createSchema

inheriteddropDatabase

  • dropDatabase(name?: string): Promise<void>
  • Parameters

    • optionalname: string

    Returns Promise<void>

dropIndexes

  • dropIndexes(options?: { collectionsWithFailedIndexes?: string[]; skipIndexes?: { collection: string; indexName: string }[] }): Promise<void>
  • Parameters

    • optionaloptions: { collectionsWithFailedIndexes?: string[]; skipIndexes?: { collection: string; indexName: string }[] }
      • optionalcollectionsWithFailedIndexes: string[]
      • optionalskipIndexes: { collection: string; indexName: string }[]

    Returns Promise<void>

dropSchema

  • dropSchema(options?: { dropMigrationsTable?: boolean }): Promise<void>
  • Parameters

    • options: { dropMigrationsTable?: boolean } = {}
      • optionaldropMigrationsTable: boolean

    Returns Promise<void>

ensureDatabase

  • ensureDatabase(): Promise<boolean>
  • Returns true if the database was created.


    Returns Promise<boolean>

ensureIndexes

  • Parameters

    Returns Promise<void>

inheritedexecute

  • execute(query: string): Promise<void>
  • Parameters

    • query: string

    Returns Promise<void>

inheritedgetCreateSchemaSQL

  • Parameters

    Returns Promise<string>

inheritedgetDropSchemaSQL

  • Parameters

    Returns Promise<string>

inheritedgetUpdateSchemaMigrationSQL

  • getUpdateSchemaMigrationSQL(options?: UpdateSchemaOptions<unknown>): Promise<{ down: string; up: string }>
  • Parameters

    Returns Promise<{ down: string; up: string }>

inheritedgetUpdateSchemaSQL

  • Parameters

    Returns Promise<string>

refreshDatabase

updateSchema

staticregister