MongoSchemaGenerator
Hierarchy
- AbstractSchemaGenerator<MongoDriver>
- MongoSchemaGenerator
Index
Constructors
constructor
Parameters
Returns MongoSchemaGenerator
Methods
clearDatabase
Parameters
optionaloptions: ClearDatabaseOptions
Returns Promise<void>
createDatabase
Parameters
optionalname: string
Returns Promise<void>
createSchema
Parameters
options: MongoCreateSchemaOptions = {}
Returns Promise<void>
dropDatabase
Parameters
optionalname: string
Returns Promise<void>
dropIndexes
Parameters
optionaloptions: { collectionsWithFailedIndexes?: string[]; skipIndexes?: { collection: string; indexName: string }[] }
optionalcollectionsWithFailedIndexes: string[]
optionalskipIndexes: { collection: string; indexName: string }[]
Returns Promise<void>
dropSchema
Parameters
options: { dropMigrationsTable?: boolean } = {}
optionaldropMigrationsTable: boolean
Returns Promise<void>
ensureDatabase
Returns true if the database was created.
Returns Promise<boolean>
ensureIndexes
Parameters
options: EnsureIndexesOptions = {}
Returns Promise<void>
execute
Parameters
query: string
Returns Promise<void>
getCreateSchemaSQL
Parameters
optionaloptions: CreateSchemaOptions
Returns Promise<string>
getDropSchemaSQL
Parameters
optionaloptions: Omit<DropSchemaOptions, dropDb>
Returns Promise<string>
getUpdateSchemaMigrationSQL
Parameters
optionaloptions: UpdateSchemaOptions<unknown>
Returns Promise<{ down: string; up: string }>
getUpdateSchemaSQL
Parameters
optionaloptions: UpdateSchemaOptions<unknown>
Returns Promise<string>
refreshDatabase
Parameters
options: MongoCreateSchemaOptions = {}
Returns Promise<void>
updateSchema
Parameters
options: MongoCreateSchemaOptions = {}
Returns Promise<void>
staticregister
Parameters
Returns void
creates new database and connects to it