@mikro-orm/mongodb 7.0.4 → 7.0.5-dev.0
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/MongoConnection.d.ts +62 -143
- package/MongoConnection.js +420 -425
- package/MongoDriver.d.ts +32 -104
- package/MongoDriver.js +421 -431
- package/MongoEntityManager.d.ts +26 -44
- package/MongoEntityManager.js +42 -42
- package/MongoEntityRepository.d.ts +11 -11
- package/MongoEntityRepository.js +20 -20
- package/MongoExceptionConverter.d.ts +4 -4
- package/MongoExceptionConverter.js +13 -13
- package/MongoMikroORM.d.ts +16 -55
- package/MongoMikroORM.js +22 -22
- package/MongoPlatform.d.ts +24 -39
- package/MongoPlatform.js +83 -83
- package/MongoSchemaGenerator.d.ts +26 -24
- package/MongoSchemaGenerator.js +209 -213
- package/README.md +1 -1
- package/index.d.ts +1 -5
- package/index.js +1 -1
- package/package.json +2 -2
package/MongoDriver.d.ts
CHANGED
|
@@ -1,112 +1,40 @@
|
|
|
1
1
|
import { type ClientSession } from 'mongodb';
|
|
2
|
-
import {
|
|
3
|
-
type Configuration,
|
|
4
|
-
type Constructor,
|
|
5
|
-
type CountOptions,
|
|
6
|
-
DatabaseDriver,
|
|
7
|
-
type EntityData,
|
|
8
|
-
type EntityDictionary,
|
|
9
|
-
type EntityField,
|
|
10
|
-
EntityManagerType,
|
|
11
|
-
type EntityName,
|
|
12
|
-
type FilterQuery,
|
|
13
|
-
type FindOneOptions,
|
|
14
|
-
type FindOptions,
|
|
15
|
-
type NativeInsertUpdateManyOptions,
|
|
16
|
-
type NativeInsertUpdateOptions,
|
|
17
|
-
type PopulateOptions,
|
|
18
|
-
type QueryResult,
|
|
19
|
-
type StreamOptions,
|
|
20
|
-
type Transaction,
|
|
21
|
-
type UpsertManyOptions,
|
|
22
|
-
type UpsertOptions,
|
|
23
|
-
} from '@mikro-orm/core';
|
|
2
|
+
import { type Configuration, type Constructor, type CountOptions, DatabaseDriver, type EntityData, type EntityDictionary, type EntityField, EntityManagerType, type EntityName, type FilterQuery, type FindOneOptions, type FindOptions, type NativeInsertUpdateManyOptions, type NativeInsertUpdateOptions, type PopulateOptions, type QueryResult, type StreamOptions, type Transaction, type UpsertManyOptions, type UpsertOptions } from '@mikro-orm/core';
|
|
24
3
|
import { MongoConnection } from './MongoConnection.js';
|
|
25
4
|
import { MongoPlatform } from './MongoPlatform.js';
|
|
26
5
|
import { MongoEntityManager } from './MongoEntityManager.js';
|
|
27
6
|
import { MongoMikroORM } from './MongoMikroORM.js';
|
|
28
7
|
/** Database driver for MongoDB. */
|
|
29
8
|
export declare class MongoDriver extends DatabaseDriver<MongoConnection> {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
entityName: EntityName<T>,
|
|
44
|
-
|
|
45
|
-
options?:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
): AsyncIterableIterator<EntityData<T>>;
|
|
62
|
-
count<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options?: CountOptions<T>): Promise<number>;
|
|
63
|
-
nativeInsert<T extends object>(
|
|
64
|
-
entityName: EntityName<T>,
|
|
65
|
-
data: EntityDictionary<T>,
|
|
66
|
-
options?: NativeInsertUpdateOptions<T>,
|
|
67
|
-
): Promise<QueryResult<T>>;
|
|
68
|
-
nativeInsertMany<T extends object>(
|
|
69
|
-
entityName: EntityName<T>,
|
|
70
|
-
data: EntityDictionary<T>[],
|
|
71
|
-
options?: NativeInsertUpdateManyOptions<T>,
|
|
72
|
-
): Promise<QueryResult<T>>;
|
|
73
|
-
nativeUpdate<T extends object>(
|
|
74
|
-
entityName: EntityName<T>,
|
|
75
|
-
where: FilterQuery<T>,
|
|
76
|
-
data: EntityDictionary<T>,
|
|
77
|
-
options?: NativeInsertUpdateOptions<T> & UpsertOptions<T>,
|
|
78
|
-
): Promise<QueryResult<T>>;
|
|
79
|
-
nativeUpdateMany<T extends object>(
|
|
80
|
-
entityName: EntityName<T>,
|
|
81
|
-
where: FilterQuery<T>[],
|
|
82
|
-
data: EntityDictionary<T>[],
|
|
83
|
-
options?: NativeInsertUpdateOptions<T> & UpsertManyOptions<T>,
|
|
84
|
-
): Promise<QueryResult<T>>;
|
|
85
|
-
nativeDelete<T extends object>(
|
|
86
|
-
entityName: EntityName<T>,
|
|
87
|
-
where: FilterQuery<T>,
|
|
88
|
-
options?: {
|
|
89
|
-
ctx?: Transaction<ClientSession>;
|
|
90
|
-
},
|
|
91
|
-
): Promise<QueryResult<T>>;
|
|
92
|
-
aggregate(entityName: EntityName, pipeline: any[], ctx?: Transaction<ClientSession>): Promise<any[]>;
|
|
93
|
-
streamAggregate<T extends object>(
|
|
94
|
-
entityName: EntityName<T>,
|
|
95
|
-
pipeline: any[],
|
|
96
|
-
ctx?: Transaction<ClientSession>,
|
|
97
|
-
): AsyncIterableIterator<T>;
|
|
98
|
-
getPlatform(): MongoPlatform;
|
|
99
|
-
private buildQueryOptions;
|
|
100
|
-
private renameFields;
|
|
101
|
-
private convertObjectIds;
|
|
102
|
-
private buildFilterById;
|
|
103
|
-
protected buildFields<T extends object, P extends string = never>(
|
|
104
|
-
entityName: EntityName<T>,
|
|
105
|
-
populate: PopulateOptions<T>[],
|
|
106
|
-
fields?: readonly EntityField<T, P>[],
|
|
107
|
-
exclude?: string[],
|
|
108
|
-
): string[] | undefined;
|
|
109
|
-
private handleVersionProperty;
|
|
110
|
-
/** @inheritDoc */
|
|
111
|
-
getORMClass(): Constructor<MongoMikroORM>;
|
|
9
|
+
[EntityManagerType]: MongoEntityManager<this>;
|
|
10
|
+
protected readonly connection: MongoConnection;
|
|
11
|
+
protected readonly platform: MongoPlatform;
|
|
12
|
+
constructor(config: Configuration);
|
|
13
|
+
createEntityManager(useContext?: boolean): this[typeof EntityManagerType];
|
|
14
|
+
stream<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options: StreamOptions<T, any, any, any> & {
|
|
15
|
+
rawResults?: boolean;
|
|
16
|
+
}): AsyncIterableIterator<T>;
|
|
17
|
+
find<T extends object, P extends string = never, F extends string = never, E extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: FindOptions<T, P, F, E>): Promise<EntityData<T>[]>;
|
|
18
|
+
findOne<T extends object, P extends string = never, F extends string = never, E extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: FindOneOptions<T, P, F, E>): Promise<EntityData<T> | null>;
|
|
19
|
+
findVirtual<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options: FindOptions<T, any, any, any>): Promise<EntityData<T>[]>;
|
|
20
|
+
streamVirtual<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options: FindOptions<T, any, any, any>): AsyncIterableIterator<EntityData<T>>;
|
|
21
|
+
count<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options?: CountOptions<T>): Promise<number>;
|
|
22
|
+
nativeInsert<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
23
|
+
nativeInsertMany<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
24
|
+
nativeUpdate<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T> & UpsertOptions<T>): Promise<QueryResult<T>>;
|
|
25
|
+
nativeUpdateMany<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateOptions<T> & UpsertManyOptions<T>): Promise<QueryResult<T>>;
|
|
26
|
+
nativeDelete<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options?: {
|
|
27
|
+
ctx?: Transaction<ClientSession>;
|
|
28
|
+
}): Promise<QueryResult<T>>;
|
|
29
|
+
aggregate(entityName: EntityName, pipeline: any[], ctx?: Transaction<ClientSession>): Promise<any[]>;
|
|
30
|
+
streamAggregate<T extends object>(entityName: EntityName<T>, pipeline: any[], ctx?: Transaction<ClientSession>): AsyncIterableIterator<T>;
|
|
31
|
+
getPlatform(): MongoPlatform;
|
|
32
|
+
private buildQueryOptions;
|
|
33
|
+
private renameFields;
|
|
34
|
+
private convertObjectIds;
|
|
35
|
+
private buildFilterById;
|
|
36
|
+
protected buildFields<T extends object, P extends string = never>(entityName: EntityName<T>, populate: PopulateOptions<T>[], fields?: readonly EntityField<T, P>[], exclude?: string[]): string[] | undefined;
|
|
37
|
+
private handleVersionProperty;
|
|
38
|
+
/** @inheritDoc */
|
|
39
|
+
getORMClass(): Constructor<MongoMikroORM>;
|
|
112
40
|
}
|