@tmlmobilidade/interfaces 20250628.311.53 → 20250628.828.28
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.
|
@@ -9,7 +9,6 @@ export declare abstract class MongoCollectionClass<T extends Document, TCreate,
|
|
|
9
9
|
protected updateSchema: null | z.ZodSchema;
|
|
10
10
|
/**
|
|
11
11
|
* Gets all documents in the collection.
|
|
12
|
-
*
|
|
13
12
|
* @returns A promise that resolves to an array of all documents
|
|
14
13
|
*/
|
|
15
14
|
all(): Promise<WithId<T>[]>;
|
|
@@ -21,28 +20,24 @@ export declare abstract class MongoCollectionClass<T extends Document, TCreate,
|
|
|
21
20
|
connect(options?: MongoClientOptions): Promise<void>;
|
|
22
21
|
/**
|
|
23
22
|
* Counts documents matching the filter criteria.
|
|
24
|
-
*
|
|
25
23
|
* @param filter - The filter criteria to match documents
|
|
26
24
|
* @returns A promise that resolves to the count of matching documents
|
|
27
25
|
*/
|
|
28
26
|
count(filter?: Filter<T>): Promise<number>;
|
|
29
27
|
/**
|
|
30
28
|
* Deletes a single document by its ID.
|
|
31
|
-
*
|
|
32
29
|
* @param id - The ID of the document to delete
|
|
33
30
|
* @returns A promise that resolves to the result of the delete operation
|
|
34
31
|
*/
|
|
35
32
|
deleteById(id: string, options?: DeleteOptions): Promise<DeleteResult>;
|
|
36
33
|
/**
|
|
37
34
|
* Deletes multiple documents matching the filter criteria.
|
|
38
|
-
*
|
|
39
35
|
* @param filter - The filter criteria to match documents to delete
|
|
40
36
|
* @returns A promise that resolves to the result of the delete operation
|
|
41
37
|
*/
|
|
42
38
|
deleteMany(filter: Filter<T>): Promise<DeleteResult>;
|
|
43
39
|
/**
|
|
44
40
|
* Deletes a single document matching the filter criteria.
|
|
45
|
-
*
|
|
46
41
|
* @param filter - The filter criteria to match the document to delete
|
|
47
42
|
* @returns A promise that resolves to the result of the delete operation
|
|
48
43
|
*/
|
|
@@ -53,21 +48,18 @@ export declare abstract class MongoCollectionClass<T extends Document, TCreate,
|
|
|
53
48
|
disconnect(): Promise<void>;
|
|
54
49
|
/**
|
|
55
50
|
* Finds all distinct values for a key in the collection.
|
|
56
|
-
*
|
|
57
51
|
* @param key - The key to find distinct values for
|
|
58
52
|
* @returns A promise that resolves to an array of distinct values for the given key
|
|
59
53
|
*/
|
|
60
54
|
distinct<K extends keyof T>(key: K): Promise<T[K][]>;
|
|
61
55
|
/**
|
|
62
56
|
* Finds a document by its ID.
|
|
63
|
-
*
|
|
64
57
|
* @param id - The ID of the document to find
|
|
65
58
|
* @returns A promise that resolves to the matching document or null if not found
|
|
66
59
|
*/
|
|
67
60
|
findById(id: string, options?: FindOptions): Promise<null | WithId<T>>;
|
|
68
61
|
/**
|
|
69
62
|
* Finds multiple documents matching the filter criteria with optional pagination and sorting.
|
|
70
|
-
*
|
|
71
63
|
* @param filter - (Optional) filter criteria to match documents
|
|
72
64
|
* @param perPage - (Optional) number of documents per page for pagination
|
|
73
65
|
* @param page - (Optional) page number for pagination
|
|
@@ -77,21 +69,22 @@ export declare abstract class MongoCollectionClass<T extends Document, TCreate,
|
|
|
77
69
|
findMany(filter?: Filter<T>, perPage?: number, page?: number, sort?: Sort): Promise<WithId<T>[]>;
|
|
78
70
|
/**
|
|
79
71
|
* Finds a single document matching the filter criteria.
|
|
80
|
-
*
|
|
81
72
|
* @param filter - The filter criteria to match the document
|
|
82
73
|
* @returns A promise that resolves to the matching document or null if not found
|
|
83
74
|
*/
|
|
84
75
|
findOne(filter: Filter<T>): Promise<null | WithId<T>>;
|
|
85
76
|
/**
|
|
86
77
|
* Gets the MongoDB collection instance.
|
|
87
|
-
*
|
|
88
78
|
* @returns The MongoDB collection instance
|
|
89
79
|
*/
|
|
90
80
|
getCollection(): Promise<Collection<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Gets the MongoDB connector instance.
|
|
83
|
+
* @returns The MongoDB connector instance
|
|
84
|
+
*/
|
|
91
85
|
getMongoConnector(): MongoConnector;
|
|
92
86
|
/**
|
|
93
87
|
* Inserts a single document into the collection.
|
|
94
|
-
*
|
|
95
88
|
* @param doc - The document to insert
|
|
96
89
|
* @param options - The options for the insert operation
|
|
97
90
|
* @returns A promise that resolves to the result of the insert operation
|
|
@@ -106,7 +99,6 @@ export declare abstract class MongoCollectionClass<T extends Document, TCreate,
|
|
|
106
99
|
}): Promise<InsertOneResult<T>>;
|
|
107
100
|
/**
|
|
108
101
|
* Updates a single document matching the filter criteria.
|
|
109
|
-
*
|
|
110
102
|
* @param filter - The filter criteria to match the document to update
|
|
111
103
|
* @param updateFields - The fields to update in the document
|
|
112
104
|
* @param options - The options for the update operation
|
|
@@ -115,7 +107,6 @@ export declare abstract class MongoCollectionClass<T extends Document, TCreate,
|
|
|
115
107
|
updateById(id: string, updateFields: TUpdate, options?: UpdateOptions): Promise<UpdateResult>;
|
|
116
108
|
/**
|
|
117
109
|
* Updates multiple documents matching the filter criteria.
|
|
118
|
-
*
|
|
119
110
|
* @param filter - The filter criteria to match documents to update
|
|
120
111
|
* @param updateFields - The fields to update in the documents
|
|
121
112
|
* @param options - The options for the update operation
|
|
@@ -124,7 +115,6 @@ export declare abstract class MongoCollectionClass<T extends Document, TCreate,
|
|
|
124
115
|
updateMany(filter: Filter<T>, updateFields: TUpdate, options?: UpdateOptions): Promise<UpdateResult<T>>;
|
|
125
116
|
/**
|
|
126
117
|
* Updates a single document matching the filter criteria.
|
|
127
|
-
*
|
|
128
118
|
* @param filter - The filter criteria to match the document to update
|
|
129
119
|
* @param updateFields - The fields to update in the document
|
|
130
120
|
* @param options - The options for the update operation
|
|
@@ -10,7 +10,6 @@ export class MongoCollectionClass {
|
|
|
10
10
|
updateSchema = null;
|
|
11
11
|
/**
|
|
12
12
|
* Gets all documents in the collection.
|
|
13
|
-
*
|
|
14
13
|
* @returns A promise that resolves to an array of all documents
|
|
15
14
|
*/
|
|
16
15
|
async all() {
|
|
@@ -45,7 +44,6 @@ export class MongoCollectionClass {
|
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
47
46
|
* Counts documents matching the filter criteria.
|
|
48
|
-
*
|
|
49
47
|
* @param filter - The filter criteria to match documents
|
|
50
48
|
* @returns A promise that resolves to the count of matching documents
|
|
51
49
|
*/
|
|
@@ -54,7 +52,6 @@ export class MongoCollectionClass {
|
|
|
54
52
|
}
|
|
55
53
|
/**
|
|
56
54
|
* Deletes a single document by its ID.
|
|
57
|
-
*
|
|
58
55
|
* @param id - The ID of the document to delete
|
|
59
56
|
* @returns A promise that resolves to the result of the delete operation
|
|
60
57
|
*/
|
|
@@ -63,7 +60,6 @@ export class MongoCollectionClass {
|
|
|
63
60
|
}
|
|
64
61
|
/**
|
|
65
62
|
* Deletes multiple documents matching the filter criteria.
|
|
66
|
-
*
|
|
67
63
|
* @param filter - The filter criteria to match documents to delete
|
|
68
64
|
* @returns A promise that resolves to the result of the delete operation
|
|
69
65
|
*/
|
|
@@ -72,7 +68,6 @@ export class MongoCollectionClass {
|
|
|
72
68
|
}
|
|
73
69
|
/**
|
|
74
70
|
* Deletes a single document matching the filter criteria.
|
|
75
|
-
*
|
|
76
71
|
* @param filter - The filter criteria to match the document to delete
|
|
77
72
|
* @returns A promise that resolves to the result of the delete operation
|
|
78
73
|
*/
|
|
@@ -87,7 +82,6 @@ export class MongoCollectionClass {
|
|
|
87
82
|
}
|
|
88
83
|
/**
|
|
89
84
|
* Finds all distinct values for a key in the collection.
|
|
90
|
-
*
|
|
91
85
|
* @param key - The key to find distinct values for
|
|
92
86
|
* @returns A promise that resolves to an array of distinct values for the given key
|
|
93
87
|
*/
|
|
@@ -96,7 +90,6 @@ export class MongoCollectionClass {
|
|
|
96
90
|
}
|
|
97
91
|
/**
|
|
98
92
|
* Finds a document by its ID.
|
|
99
|
-
*
|
|
100
93
|
* @param id - The ID of the document to find
|
|
101
94
|
* @returns A promise that resolves to the matching document or null if not found
|
|
102
95
|
*/
|
|
@@ -105,7 +98,6 @@ export class MongoCollectionClass {
|
|
|
105
98
|
}
|
|
106
99
|
/**
|
|
107
100
|
* Finds multiple documents matching the filter criteria with optional pagination and sorting.
|
|
108
|
-
*
|
|
109
101
|
* @param filter - (Optional) filter criteria to match documents
|
|
110
102
|
* @param perPage - (Optional) number of documents per page for pagination
|
|
111
103
|
* @param page - (Optional) page number for pagination
|
|
@@ -124,7 +116,6 @@ export class MongoCollectionClass {
|
|
|
124
116
|
}
|
|
125
117
|
/**
|
|
126
118
|
* Finds a single document matching the filter criteria.
|
|
127
|
-
*
|
|
128
119
|
* @param filter - The filter criteria to match the document
|
|
129
120
|
* @returns A promise that resolves to the matching document or null if not found
|
|
130
121
|
*/
|
|
@@ -133,18 +124,20 @@ export class MongoCollectionClass {
|
|
|
133
124
|
}
|
|
134
125
|
/**
|
|
135
126
|
* Gets the MongoDB collection instance.
|
|
136
|
-
*
|
|
137
127
|
* @returns The MongoDB collection instance
|
|
138
128
|
*/
|
|
139
129
|
async getCollection() {
|
|
140
130
|
return this.mongoCollection;
|
|
141
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Gets the MongoDB connector instance.
|
|
134
|
+
* @returns The MongoDB connector instance
|
|
135
|
+
*/
|
|
142
136
|
getMongoConnector() {
|
|
143
137
|
return this.mongoConnector;
|
|
144
138
|
}
|
|
145
139
|
/**
|
|
146
140
|
* Inserts a single document into the collection.
|
|
147
|
-
*
|
|
148
141
|
* @param doc - The document to insert
|
|
149
142
|
* @param options - The options for the insert operation
|
|
150
143
|
* @returns A promise that resolves to the result of the insert operation
|
|
@@ -177,7 +170,6 @@ export class MongoCollectionClass {
|
|
|
177
170
|
}
|
|
178
171
|
/**
|
|
179
172
|
* Updates a single document matching the filter criteria.
|
|
180
|
-
*
|
|
181
173
|
* @param filter - The filter criteria to match the document to update
|
|
182
174
|
* @param updateFields - The fields to update in the document
|
|
183
175
|
* @param options - The options for the update operation
|
|
@@ -207,7 +199,6 @@ export class MongoCollectionClass {
|
|
|
207
199
|
// }
|
|
208
200
|
/**
|
|
209
201
|
* Updates multiple documents matching the filter criteria.
|
|
210
|
-
*
|
|
211
202
|
* @param filter - The filter criteria to match documents to update
|
|
212
203
|
* @param updateFields - The fields to update in the documents
|
|
213
204
|
* @param options - The options for the update operation
|
|
@@ -227,7 +218,6 @@ export class MongoCollectionClass {
|
|
|
227
218
|
}
|
|
228
219
|
/**
|
|
229
220
|
* Updates a single document matching the filter criteria.
|
|
230
|
-
*
|
|
231
221
|
* @param filter - The filter criteria to match the document to update
|
|
232
222
|
* @param updateFields - The fields to update in the document
|
|
233
223
|
* @param options - The options for the update operation
|
package/package.json
CHANGED