@mikro-orm/mongodb 7.2.0-dev.5 → 7.2.0-dev.7

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.
@@ -18,6 +18,8 @@ export declare class MongoConnection extends Connection {
18
18
  error?: Error;
19
19
  }>;
20
20
  getClient(): MongoClient;
21
+ /** Returns the `MongoClient` backing this connection, the async counterpart of `getClient()`. */
22
+ getNativeClient(): Promise<MongoClient>;
21
23
  getCollection<T extends object>(name: EntityName<T> | string): Collection<T>;
22
24
  createCollection<T extends object>(name: EntityName<T>): Promise<Collection<T>>;
23
25
  listCollections(): Promise<string[]>;
@@ -76,6 +76,11 @@ export class MongoConnection extends Connection {
76
76
  }
77
77
  return this.#client;
78
78
  }
79
+ /** Returns the `MongoClient` backing this connection, the async counterpart of `getClient()`. */
80
+ async getNativeClient() {
81
+ await this.ensureConnection();
82
+ return this.getClient();
83
+ }
79
84
  getCollection(name) {
80
85
  return this.getDb().collection(this.getCollectionName(name));
81
86
  }
@@ -32,8 +32,7 @@ export class MongoEntityManager extends EntityManager {
32
32
  */
33
33
  async countBy(entityName, groupBy, options = {}) {
34
34
  const em = this.getContext(false);
35
- options = { ...options };
36
- em.prepareOptions(options);
35
+ options = em.prepareOptions(options);
37
36
  const meta = em.getMetadata().find(entityName);
38
37
  const fields = Utils.asArray(groupBy);
39
38
  if (options.having) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mongodb",
3
- "version": "7.2.0-dev.5",
3
+ "version": "7.2.0-dev.7",
4
4
  "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.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.1.11"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.0-dev.5"
56
+ "@mikro-orm/core": "7.2.0-dev.7"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"