MongoSchemaGenerator
Hierarchy
- AbstractSchemaGenerator<MongoDriver>
- MongoSchemaGenerator
Index
Constructors
constructor
Parameters
em: EntityManager<IDatabaseDriver<Connection>> | MongoDriver
Returns MongoSchemaGenerator
Methods
clearDatabase
Parameters
optionaloptions: { schema?: string }
optionalschema: string
Returns Promise<void>
createDatabase
Parameters
name: string
Returns Promise<void>
createSchema
Parameters
options: CreateSchemaOptions = {}
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>
generate
Returns Promise<string>
getCreateSchemaSQL
Returns Promise<string>
getDropSchemaSQL
Returns Promise<string>
getUpdateSchemaMigrationSQL
Returns Promise<{ down: string; up: string }>
getUpdateSchemaSQL
Returns Promise<string>
refreshDatabase
Parameters
options: CreateSchemaOptions = {}
Returns Promise<void>
updateSchema
Parameters
options: CreateSchemaOptions = {}
Returns Promise<void>
staticregister
Parameters
orm: MikroORM<IDatabaseDriver<Connection>>
Returns void
creates new database and connects to it