@mikro-orm/mongodb 7.1.0-dev.11 → 7.1.0-dev.12

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.
@@ -68,6 +68,7 @@ export interface MongoFindOptions<T extends object> extends MongoQueryOptions {
68
68
  limit?: number;
69
69
  offset?: number;
70
70
  fields?: string[];
71
+ chunkSize?: number;
71
72
  ctx?: Transaction<ClientSession>;
72
73
  loggerContext?: LoggingOptions;
73
74
  }
@@ -143,6 +143,9 @@ export class MongoConnection extends Connection {
143
143
  if (opts.allowDiskUse != null) {
144
144
  options.allowDiskUse = opts.allowDiskUse;
145
145
  }
146
+ if (opts.chunkSize != null) {
147
+ options.batchSize = opts.chunkSize;
148
+ }
146
149
  const resultSet = this.getCollection(entityName).find(where, options);
147
150
  let query = `db.getCollection('${collection}').find(${this.logObject(where)}, ${this.logObject(options)})`;
148
151
  const orderBy = Utils.asArray(opts.orderBy);
package/MongoDriver.js CHANGED
@@ -30,6 +30,7 @@ export class MongoDriver extends DatabaseDriver {
30
30
  offset: options.offset,
31
31
  fields,
32
32
  ctx: options.ctx,
33
+ chunkSize: options.chunkSize ?? 100,
33
34
  ...this.buildQueryOptions(options),
34
35
  });
35
36
  for await (const item of res) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mongodb",
3
- "version": "7.1.0-dev.11",
3
+ "version": "7.1.0-dev.12",
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.0.11"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.1.0-dev.11"
56
+ "@mikro-orm/core": "7.1.0-dev.12"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"