@mikro-orm/mongodb 7.0.0-dev.68 → 7.0.0-dev.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,13 +2,13 @@ import { AbstractSchemaGenerator, type CreateSchemaOptions, type MikroORM } from
2
2
  import type { MongoDriver } from './MongoDriver.js';
3
3
  export declare class MongoSchemaGenerator extends AbstractSchemaGenerator<MongoDriver> {
4
4
  static register(orm: MikroORM): void;
5
- createSchema(options?: MongoCreateSchemaOptions): Promise<void>;
6
- dropSchema(options?: {
5
+ create(options?: MongoCreateSchemaOptions): Promise<void>;
6
+ drop(options?: {
7
7
  dropMigrationsTable?: boolean;
8
8
  }): Promise<void>;
9
- updateSchema(options?: MongoCreateSchemaOptions): Promise<void>;
9
+ update(options?: MongoCreateSchemaOptions): Promise<void>;
10
10
  ensureDatabase(): Promise<boolean>;
11
- refreshDatabase(options?: MongoCreateSchemaOptions): Promise<void>;
11
+ refresh(options?: MongoCreateSchemaOptions): Promise<void>;
12
12
  dropIndexes(options?: {
13
13
  skipIndexes?: {
14
14
  collection: string;
@@ -4,7 +4,7 @@ export class MongoSchemaGenerator extends AbstractSchemaGenerator {
4
4
  static register(orm) {
5
5
  orm.config.registerExtension('@mikro-orm/schema-generator', () => new MongoSchemaGenerator(orm.em));
6
6
  }
7
- async createSchema(options = {}) {
7
+ async create(options = {}) {
8
8
  await this.connection.ensureConnection();
9
9
  options.ensureIndexes ??= true;
10
10
  const existing = await this.connection.listCollections();
@@ -25,7 +25,7 @@ export class MongoSchemaGenerator extends AbstractSchemaGenerator {
25
25
  }
26
26
  await Promise.all(promises);
27
27
  }
28
- async dropSchema(options = {}) {
28
+ async drop(options = {}) {
29
29
  await this.connection.ensureConnection();
30
30
  const existing = await this.connection.listCollections();
31
31
  const metadata = this.getOrderedMetadata();
@@ -37,16 +37,16 @@ export class MongoSchemaGenerator extends AbstractSchemaGenerator {
37
37
  .map(meta => this.connection.dropCollection(meta.collection));
38
38
  await Promise.all(promises);
39
39
  }
40
- async updateSchema(options = {}) {
41
- await this.createSchema(options);
40
+ async update(options = {}) {
41
+ await this.create(options);
42
42
  }
43
43
  async ensureDatabase() {
44
44
  return false;
45
45
  }
46
- async refreshDatabase(options = {}) {
46
+ async refresh(options = {}) {
47
47
  await this.ensureDatabase();
48
- await this.dropSchema();
49
- await this.createSchema(options);
48
+ await this.drop();
49
+ await this.create(options);
50
50
  }
51
51
  async dropIndexes(options) {
52
52
  await this.connection.ensureConnection();
@@ -73,7 +73,7 @@ export class MongoSchemaGenerator extends AbstractSchemaGenerator {
73
73
  options.ensureCollections ??= true;
74
74
  options.retryLimit ??= 3;
75
75
  if (options.ensureCollections) {
76
- await this.createSchema({ ensureIndexes: false });
76
+ await this.create({ ensureIndexes: false });
77
77
  }
78
78
  const promises = [];
79
79
  for (const meta of this.getOrderedMetadata()) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mikro-orm/mongodb",
3
3
  "type": "module",
4
- "version": "7.0.0-dev.68",
4
+ "version": "7.0.0-dev.69",
5
5
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
6
6
  "exports": {
7
7
  "./package.json": "./package.json",
@@ -56,6 +56,6 @@
56
56
  "@mikro-orm/core": "^6.6.1"
57
57
  },
58
58
  "peerDependencies": {
59
- "@mikro-orm/core": "7.0.0-dev.68"
59
+ "@mikro-orm/core": "7.0.0-dev.69"
60
60
  }
61
61
  }