@mikro-orm/mongodb 7.1.0-dev.4 → 7.1.0-dev.6
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.
- package/MongoDriver.js +7 -0
- package/MongoEntityManager.d.ts +2 -2
- package/package.json +2 -2
package/MongoDriver.js
CHANGED
|
@@ -268,6 +268,13 @@ export class MongoDriver extends DatabaseDriver {
|
|
|
268
268
|
if (options.indexHint != null) {
|
|
269
269
|
ret.indexHint = options.indexHint;
|
|
270
270
|
}
|
|
271
|
+
else if (options.using != null) {
|
|
272
|
+
const names = Utils.asArray(options.using);
|
|
273
|
+
if (names.length > 1) {
|
|
274
|
+
throw new Error('MongoDB only supports a single index hint per query. Provide one index name instead of an array.');
|
|
275
|
+
}
|
|
276
|
+
ret.indexHint = names[0];
|
|
277
|
+
}
|
|
271
278
|
if (options.maxTimeMS != null) {
|
|
272
279
|
ret.maxTimeMS = options.maxTimeMS;
|
|
273
280
|
}
|
package/MongoEntityManager.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityManager, type EntityName, type EntityRepository, type GetRepository, type TransactionOptions, type StreamOptions, type Loaded } from '@mikro-orm/core';
|
|
1
|
+
import { EntityManager, type EntityName, type EntityRepository, type GetRepository, type TransactionOptions, type StreamOptions, type Loaded, type WithUsingOptions } from '@mikro-orm/core';
|
|
2
2
|
import type { Collection, Document, TransactionOptions as MongoTransactionOptions } from 'mongodb';
|
|
3
3
|
import type { MongoDriver } from './MongoDriver.js';
|
|
4
4
|
import type { MongoEntityRepository } from './MongoEntityRepository.js';
|
|
@@ -17,7 +17,7 @@ export declare class MongoEntityManager<Driver extends MongoDriver = MongoDriver
|
|
|
17
17
|
/**
|
|
18
18
|
* @inheritDoc
|
|
19
19
|
*/
|
|
20
|
-
stream<Entity extends object, Hint extends string = never, Fields extends string = never, Excludes extends string = never>(entityName: EntityName<Entity>, options?: StreamOptions<NoInfer<Entity>, Hint, Fields, Excludes>): AsyncIterableIterator<Loaded<Entity, Hint, Fields, Excludes>>;
|
|
20
|
+
stream<Entity extends object, Hint extends string = never, Fields extends string = never, Excludes extends string = never, Using extends string = never>(entityName: EntityName<Entity>, options?: WithUsingOptions<StreamOptions<NoInfer<Entity>, Hint, Fields, Excludes>, NoInfer<Entity>, Using>): AsyncIterableIterator<Loaded<Entity, Hint, Fields, Excludes>>;
|
|
21
21
|
getCollection<T extends Document>(entityOrCollectionName: EntityName<T> | string): Collection<T>;
|
|
22
22
|
/**
|
|
23
23
|
* @inheritDoc
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mongodb",
|
|
3
|
-
"version": "7.1.0-dev.
|
|
3
|
+
"version": "7.1.0-dev.6",
|
|
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.
|
|
56
|
+
"@mikro-orm/core": "7.1.0-dev.6"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|