@event-driven-io/pongo 0.17.0-beta.35 → 0.17.0-beta.36
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/dist/cli.cjs +311 -494
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +4 -4
- package/dist/cli.d.ts +4 -3
- package/dist/cli.js +279 -494
- package/dist/cli.js.map +1 -1
- package/dist/cloudflare.cjs +36 -48
- package/dist/cloudflare.cjs.map +1 -1
- package/dist/cloudflare.d.cts +7 -7
- package/dist/cloudflare.d.ts +7 -7
- package/dist/cloudflare.js +29 -47
- package/dist/cloudflare.js.map +1 -1
- package/dist/core-CwxxuUAn.cjs +1590 -0
- package/dist/core-CwxxuUAn.cjs.map +1 -0
- package/dist/core-D_iZiiYe.js +1308 -0
- package/dist/core-D_iZiiYe.js.map +1 -0
- package/dist/core-DwoTLYbR.cjs +319 -0
- package/dist/core-DwoTLYbR.cjs.map +1 -0
- package/dist/core-fsJmsQDa.js +307 -0
- package/dist/core-fsJmsQDa.js.map +1 -0
- package/dist/index-DMq6F3x9.d.ts +705 -0
- package/dist/index-Du_IHXAj.d.ts +10 -0
- package/dist/index-ZKOB86ub.d.cts +10 -0
- package/dist/index-qeC-p0Tq.d.cts +705 -0
- package/dist/index.cjs +61 -118
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -130
- package/dist/index.d.ts +11 -130
- package/dist/index.js +14 -119
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +214 -320
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +24 -22
- package/dist/pg.d.ts +24 -22
- package/dist/pg.js +209 -321
- package/dist/pg.js.map +1 -1
- package/dist/shim.cjs +281 -367
- package/dist/shim.cjs.map +1 -1
- package/dist/shim.d.cts +140 -137
- package/dist/shim.d.ts +140 -137
- package/dist/shim.js +275 -366
- package/dist/shim.js.map +1 -1
- package/dist/sqlite3.cjs +41 -56
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +9 -9
- package/dist/sqlite3.d.ts +9 -9
- package/dist/sqlite3.js +35 -56
- package/dist/sqlite3.js.map +1 -1
- package/package.json +15 -15
- package/dist/chunk-EQ3T4XHT.cjs +0 -1583
- package/dist/chunk-EQ3T4XHT.cjs.map +0 -1
- package/dist/chunk-H6YIW5C5.js +0 -399
- package/dist/chunk-H6YIW5C5.js.map +0 -1
- package/dist/chunk-NTHMSHNG.cjs +0 -399
- package/dist/chunk-NTHMSHNG.cjs.map +0 -1
- package/dist/chunk-NWYI26VT.js +0 -1583
- package/dist/chunk-NWYI26VT.js.map +0 -1
- package/dist/index-BfBszcG4.d.ts +0 -8
- package/dist/index-a-fxODW1.d.cts +0 -8
- package/dist/pongoTransactionCache-CRuPGag3.d.cts +0 -556
- package/dist/pongoTransactionCache-CRuPGag3.d.ts +0 -556
package/dist/shim.cjs
CHANGED
|
@@ -1,380 +1,294 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_core = require('./core-CwxxuUAn.cjs');
|
|
3
|
+
const require_cli = require('./cli.cjs');
|
|
4
|
+
let _event_driven_io_dumbo = require("@event-driven-io/dumbo");
|
|
2
5
|
|
|
6
|
+
//#region src/mongo/findCursor.ts
|
|
7
|
+
var FindCursor = class {
|
|
8
|
+
findDocumentsPromise;
|
|
9
|
+
documents = null;
|
|
10
|
+
index = 0;
|
|
11
|
+
constructor(documents) {
|
|
12
|
+
this.findDocumentsPromise = documents;
|
|
13
|
+
}
|
|
14
|
+
async toArray() {
|
|
15
|
+
return this.findDocuments();
|
|
16
|
+
}
|
|
17
|
+
async forEach(callback) {
|
|
18
|
+
const docs = await this.findDocuments();
|
|
19
|
+
for (const doc of docs) callback(doc);
|
|
20
|
+
return Promise.resolve();
|
|
21
|
+
}
|
|
22
|
+
hasNext() {
|
|
23
|
+
if (this.documents === null) throw Error("Error while fetching documents");
|
|
24
|
+
return this.index < this.documents.length;
|
|
25
|
+
}
|
|
26
|
+
async next() {
|
|
27
|
+
const docs = await this.findDocuments();
|
|
28
|
+
return this.hasNext() ? docs[this.index++] ?? null : null;
|
|
29
|
+
}
|
|
30
|
+
async findDocuments() {
|
|
31
|
+
this.documents = await this.findDocumentsPromise;
|
|
32
|
+
return this.documents;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
3
35
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return this.findDocuments();
|
|
16
|
-
}
|
|
17
|
-
async forEach(callback) {
|
|
18
|
-
const docs = await this.findDocuments();
|
|
19
|
-
for (const doc of docs) {
|
|
20
|
-
callback(doc);
|
|
21
|
-
}
|
|
22
|
-
return Promise.resolve();
|
|
23
|
-
}
|
|
24
|
-
hasNext() {
|
|
25
|
-
if (this.documents === null) throw Error("Error while fetching documents");
|
|
26
|
-
return this.index < this.documents.length;
|
|
27
|
-
}
|
|
28
|
-
async next() {
|
|
29
|
-
const docs = await this.findDocuments();
|
|
30
|
-
return this.hasNext() ? _nullishCoalesce(docs[this.index++], () => ( null)) : null;
|
|
31
|
-
}
|
|
32
|
-
async findDocuments() {
|
|
33
|
-
this.documents = await this.findDocumentsPromise;
|
|
34
|
-
return this.documents;
|
|
35
|
-
}
|
|
36
|
-
}, _class);
|
|
37
|
-
|
|
38
|
-
// src/mongo/mongoClient.ts
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _dumbo = require('@event-driven-io/dumbo');
|
|
43
|
-
|
|
44
|
-
// src/mongo/mongoCollection.ts
|
|
45
|
-
var toCollectionOperationOptions = (options) => _optionalChain([options, 'optionalAccess', _ => _.session]) ? { session: options.session } : void 0;
|
|
46
|
-
var toFindOptions = (options) => {
|
|
47
|
-
if (!_optionalChain([options, 'optionalAccess', _2 => _2.session]) && !_optionalChain([options, 'optionalAccess', _3 => _3.limit]) && !_optionalChain([options, 'optionalAccess', _4 => _4.skip])) {
|
|
48
|
-
return void 0;
|
|
49
|
-
}
|
|
50
|
-
const pongoFindOptions = {};
|
|
51
|
-
if (_optionalChain([options, 'optionalAccess', _5 => _5.session])) {
|
|
52
|
-
pongoFindOptions.session = options.session;
|
|
53
|
-
}
|
|
54
|
-
if (_optionalChain([options, 'optionalAccess', _6 => _6.limit]) !== void 0) {
|
|
55
|
-
pongoFindOptions.limit = options.limit;
|
|
56
|
-
}
|
|
57
|
-
if (_optionalChain([options, 'optionalAccess', _7 => _7.skip]) !== void 0) {
|
|
58
|
-
pongoFindOptions.skip = options.skip;
|
|
59
|
-
}
|
|
60
|
-
return pongoFindOptions;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/mongo/mongoCollection.ts
|
|
38
|
+
const toCollectionOperationOptions = (options) => options?.session ? { session: options.session } : void 0;
|
|
39
|
+
const toFindOptions = (options) => {
|
|
40
|
+
if (!options?.session && !options?.limit && !options?.skip && !options?.sort) return;
|
|
41
|
+
const pongoFindOptions = {};
|
|
42
|
+
if (options?.session) pongoFindOptions.session = options.session;
|
|
43
|
+
if (options?.limit !== void 0) pongoFindOptions.limit = options.limit;
|
|
44
|
+
if (options?.skip !== void 0) pongoFindOptions.skip = options.skip;
|
|
45
|
+
if (options?.sort !== void 0) pongoFindOptions.sort = options.sort;
|
|
46
|
+
return pongoFindOptions;
|
|
61
47
|
};
|
|
62
48
|
var Collection = class {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
indexes(_options) {
|
|
245
|
-
throw new Error("Method not implemented.");
|
|
246
|
-
}
|
|
247
|
-
findOneAndDelete(filter, options) {
|
|
248
|
-
return this.collection.findOneAndDelete(
|
|
249
|
-
filter,
|
|
250
|
-
toCollectionOperationOptions(options)
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
findOneAndReplace(filter, replacement, options) {
|
|
254
|
-
return this.collection.findOneAndReplace(
|
|
255
|
-
filter,
|
|
256
|
-
replacement,
|
|
257
|
-
toCollectionOperationOptions(options)
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
findOneAndUpdate(filter, update, options) {
|
|
261
|
-
return this.collection.findOneAndUpdate(
|
|
262
|
-
filter,
|
|
263
|
-
update,
|
|
264
|
-
toCollectionOperationOptions(options)
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
aggregate(_pipeline, _options) {
|
|
268
|
-
throw new Error("Method not implemented.");
|
|
269
|
-
}
|
|
270
|
-
watch(_pipeline, _options) {
|
|
271
|
-
throw new Error("Method not implemented.");
|
|
272
|
-
}
|
|
273
|
-
initializeUnorderedBulkOp(_options) {
|
|
274
|
-
throw new Error("Method not implemented.");
|
|
275
|
-
}
|
|
276
|
-
initializeOrderedBulkOp(_options) {
|
|
277
|
-
throw new Error("Method not implemented.");
|
|
278
|
-
}
|
|
279
|
-
count(filter, options) {
|
|
280
|
-
return this.collection.countDocuments(
|
|
281
|
-
_nullishCoalesce(filter, () => ( {})),
|
|
282
|
-
toCollectionOperationOptions(options)
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
listSearchIndexes(_name, _options) {
|
|
286
|
-
throw new Error("Method not implemented.");
|
|
287
|
-
}
|
|
288
|
-
createSearchIndex(_description) {
|
|
289
|
-
throw new Error("Method not implemented.");
|
|
290
|
-
}
|
|
291
|
-
createSearchIndexes(_descriptions) {
|
|
292
|
-
throw new Error("Method not implemented.");
|
|
293
|
-
}
|
|
294
|
-
dropSearchIndex(_name) {
|
|
295
|
-
throw new Error("Method not implemented.");
|
|
296
|
-
}
|
|
297
|
-
updateSearchIndex(_name, _definition) {
|
|
298
|
-
throw new Error("Method not implemented.");
|
|
299
|
-
}
|
|
300
|
-
async createCollection() {
|
|
301
|
-
await this.collection.createCollection();
|
|
302
|
-
}
|
|
303
|
-
async handle(id, handle, options) {
|
|
304
|
-
return this.collection.handle(id.toString(), handle, options);
|
|
305
|
-
}
|
|
49
|
+
collection;
|
|
50
|
+
database;
|
|
51
|
+
constructor(database, collection) {
|
|
52
|
+
this.collection = collection;
|
|
53
|
+
this.database = database;
|
|
54
|
+
}
|
|
55
|
+
get db() {
|
|
56
|
+
return this.database;
|
|
57
|
+
}
|
|
58
|
+
get dbName() {
|
|
59
|
+
return this.collection.dbName;
|
|
60
|
+
}
|
|
61
|
+
get collectionName() {
|
|
62
|
+
return this.collection.collectionName;
|
|
63
|
+
}
|
|
64
|
+
get namespace() {
|
|
65
|
+
return `${this.dbName}.${this.collectionName}`;
|
|
66
|
+
}
|
|
67
|
+
get readConcern() {}
|
|
68
|
+
get readPreference() {}
|
|
69
|
+
get bsonOptions() {
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
72
|
+
get writeConcern() {}
|
|
73
|
+
get hint() {}
|
|
74
|
+
get timeoutMS() {}
|
|
75
|
+
set hint(v) {
|
|
76
|
+
throw new Error("Method not implemented.");
|
|
77
|
+
}
|
|
78
|
+
async insertOne(doc, options) {
|
|
79
|
+
const result = await this.collection.insertOne(doc, toCollectionOperationOptions(options));
|
|
80
|
+
return {
|
|
81
|
+
acknowledged: result.acknowledged,
|
|
82
|
+
insertedId: result.insertedId
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async insertMany(docs, options) {
|
|
86
|
+
const result = await this.collection.insertMany(docs, toCollectionOperationOptions(options));
|
|
87
|
+
return {
|
|
88
|
+
acknowledged: result.acknowledged,
|
|
89
|
+
insertedIds: result.insertedIds,
|
|
90
|
+
insertedCount: result.insertedCount
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
bulkWrite(_operations, _options) {
|
|
94
|
+
throw new Error("Method not implemented.");
|
|
95
|
+
}
|
|
96
|
+
async updateOne(filter, update, options) {
|
|
97
|
+
const result = await this.collection.updateOne(filter, update, toCollectionOperationOptions(options));
|
|
98
|
+
return {
|
|
99
|
+
acknowledged: result.acknowledged,
|
|
100
|
+
matchedCount: result.modifiedCount,
|
|
101
|
+
modifiedCount: result.modifiedCount,
|
|
102
|
+
upsertedCount: result.modifiedCount,
|
|
103
|
+
upsertedId: null
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
replaceOne(filter, document, options) {
|
|
107
|
+
return this.collection.replaceOne(filter, document, toCollectionOperationOptions(options));
|
|
108
|
+
}
|
|
109
|
+
async updateMany(filter, update, options) {
|
|
110
|
+
const result = await this.collection.updateMany(filter, update, toCollectionOperationOptions(options));
|
|
111
|
+
return {
|
|
112
|
+
acknowledged: result.acknowledged,
|
|
113
|
+
matchedCount: result.modifiedCount,
|
|
114
|
+
modifiedCount: result.modifiedCount,
|
|
115
|
+
upsertedCount: result.modifiedCount,
|
|
116
|
+
upsertedId: null
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async deleteOne(filter, options) {
|
|
120
|
+
const result = await this.collection.deleteOne(filter, toCollectionOperationOptions(options));
|
|
121
|
+
return {
|
|
122
|
+
acknowledged: result.acknowledged,
|
|
123
|
+
deletedCount: result.deletedCount
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
async deleteMany(filter, options) {
|
|
127
|
+
const result = await this.collection.deleteMany(filter, toCollectionOperationOptions(options));
|
|
128
|
+
return {
|
|
129
|
+
acknowledged: result.acknowledged,
|
|
130
|
+
deletedCount: result.deletedCount
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
async rename(newName, options) {
|
|
134
|
+
await this.collection.rename(newName, toCollectionOperationOptions(options));
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
drop(options) {
|
|
138
|
+
return this.collection.drop(toCollectionOperationOptions(options));
|
|
139
|
+
}
|
|
140
|
+
async findOne(filter, options) {
|
|
141
|
+
return await this.collection.findOne(filter, toCollectionOperationOptions(options));
|
|
142
|
+
}
|
|
143
|
+
find(filter, options) {
|
|
144
|
+
return new FindCursor(this.collection.find(filter, toFindOptions(options)));
|
|
145
|
+
}
|
|
146
|
+
options(_options) {
|
|
147
|
+
throw new Error("Method not implemented.");
|
|
148
|
+
}
|
|
149
|
+
isCapped(_options) {
|
|
150
|
+
throw new Error("Method not implemented.");
|
|
151
|
+
}
|
|
152
|
+
createIndex(_indexSpec, _options) {
|
|
153
|
+
throw new Error("Method not implemented.");
|
|
154
|
+
}
|
|
155
|
+
createIndexes(_indexSpecs, _options) {
|
|
156
|
+
throw new Error("Method not implemented.");
|
|
157
|
+
}
|
|
158
|
+
dropIndex(_indexName, _options) {
|
|
159
|
+
throw new Error("Method not implemented.");
|
|
160
|
+
}
|
|
161
|
+
dropIndexes(_options) {
|
|
162
|
+
throw new Error("Method not implemented.");
|
|
163
|
+
}
|
|
164
|
+
listIndexes(_options) {
|
|
165
|
+
throw new Error("Method not implemented.");
|
|
166
|
+
}
|
|
167
|
+
indexExists(_indexes, _options) {
|
|
168
|
+
throw new Error("Method not implemented.");
|
|
169
|
+
}
|
|
170
|
+
indexInformation(_options) {
|
|
171
|
+
throw new Error("Method not implemented.");
|
|
172
|
+
}
|
|
173
|
+
estimatedDocumentCount(options) {
|
|
174
|
+
return this.collection.countDocuments({}, toCollectionOperationOptions(options));
|
|
175
|
+
}
|
|
176
|
+
countDocuments(filter, options) {
|
|
177
|
+
return this.collection.countDocuments(filter, toCollectionOperationOptions(options));
|
|
178
|
+
}
|
|
179
|
+
distinct(_key, _filter, _options) {
|
|
180
|
+
throw new Error("Method not implemented.");
|
|
181
|
+
}
|
|
182
|
+
indexes(_options) {
|
|
183
|
+
throw new Error("Method not implemented.");
|
|
184
|
+
}
|
|
185
|
+
findOneAndDelete(filter, options) {
|
|
186
|
+
return this.collection.findOneAndDelete(filter, toCollectionOperationOptions(options));
|
|
187
|
+
}
|
|
188
|
+
findOneAndReplace(filter, replacement, options) {
|
|
189
|
+
return this.collection.findOneAndReplace(filter, replacement, toCollectionOperationOptions(options));
|
|
190
|
+
}
|
|
191
|
+
findOneAndUpdate(filter, update, options) {
|
|
192
|
+
return this.collection.findOneAndUpdate(filter, update, toCollectionOperationOptions(options));
|
|
193
|
+
}
|
|
194
|
+
aggregate(_pipeline, _options) {
|
|
195
|
+
throw new Error("Method not implemented.");
|
|
196
|
+
}
|
|
197
|
+
watch(_pipeline, _options) {
|
|
198
|
+
throw new Error("Method not implemented.");
|
|
199
|
+
}
|
|
200
|
+
initializeUnorderedBulkOp(_options) {
|
|
201
|
+
throw new Error("Method not implemented.");
|
|
202
|
+
}
|
|
203
|
+
initializeOrderedBulkOp(_options) {
|
|
204
|
+
throw new Error("Method not implemented.");
|
|
205
|
+
}
|
|
206
|
+
count(filter, options) {
|
|
207
|
+
return this.collection.countDocuments(filter ?? {}, toCollectionOperationOptions(options));
|
|
208
|
+
}
|
|
209
|
+
listSearchIndexes(_name, _options) {
|
|
210
|
+
throw new Error("Method not implemented.");
|
|
211
|
+
}
|
|
212
|
+
createSearchIndex(_description) {
|
|
213
|
+
throw new Error("Method not implemented.");
|
|
214
|
+
}
|
|
215
|
+
createSearchIndexes(_descriptions) {
|
|
216
|
+
throw new Error("Method not implemented.");
|
|
217
|
+
}
|
|
218
|
+
dropSearchIndex(_name) {
|
|
219
|
+
throw new Error("Method not implemented.");
|
|
220
|
+
}
|
|
221
|
+
updateSearchIndex(_name, _definition) {
|
|
222
|
+
throw new Error("Method not implemented.");
|
|
223
|
+
}
|
|
224
|
+
async createCollection() {
|
|
225
|
+
await this.collection.createCollection();
|
|
226
|
+
}
|
|
227
|
+
async handle(id, handle, options) {
|
|
228
|
+
return this.collection.handle(id.toString(), handle, options);
|
|
229
|
+
}
|
|
306
230
|
};
|
|
307
231
|
|
|
308
|
-
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/mongo/mongoDb.ts
|
|
309
234
|
var Db = class {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
this.pongoDb.collection(collectionName, options)
|
|
321
|
-
);
|
|
322
|
-
}
|
|
235
|
+
pongoDb;
|
|
236
|
+
constructor(pongoDb) {
|
|
237
|
+
this.pongoDb = pongoDb;
|
|
238
|
+
}
|
|
239
|
+
get databaseName() {
|
|
240
|
+
return this.pongoDb.databaseName;
|
|
241
|
+
}
|
|
242
|
+
collection(collectionName, options) {
|
|
243
|
+
return new Collection(this, this.pongoDb.collection(collectionName, options));
|
|
244
|
+
}
|
|
323
245
|
};
|
|
324
246
|
|
|
325
|
-
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/mongo/mongoClient.ts
|
|
326
249
|
var MongoClient = class {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
async withSession(optionsOrExecutor, executor) {
|
|
365
|
-
const callback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor;
|
|
366
|
-
const session = _chunkEQ3T4XHTcjs.pongoSession.call(void 0, );
|
|
367
|
-
try {
|
|
368
|
-
return await callback(session);
|
|
369
|
-
} finally {
|
|
370
|
-
await session.endSession();
|
|
371
|
-
}
|
|
372
|
-
}
|
|
250
|
+
pongoClient;
|
|
251
|
+
constructor(connectionStringOrOptions, options) {
|
|
252
|
+
if (typeof connectionStringOrOptions !== "string") {
|
|
253
|
+
this.pongoClient = require_core.pongoClient(connectionStringOrOptions);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const { databaseType, driverName } = (0, _event_driven_io_dumbo.parseConnectionString)(connectionStringOrOptions);
|
|
257
|
+
const driver = options?.driver ?? pongoDriverRegistry.tryGet((0, _event_driven_io_dumbo.toDatabaseDriverType)(databaseType, driverName));
|
|
258
|
+
if (driver === null) throw new Error(`No database driver registered for ${databaseType} with name ${driverName}`);
|
|
259
|
+
this.pongoClient = require_core.pongoClient({
|
|
260
|
+
...options ?? {},
|
|
261
|
+
connectionString: connectionStringOrOptions,
|
|
262
|
+
driver
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
async connect() {
|
|
266
|
+
await this.pongoClient.connect();
|
|
267
|
+
return this;
|
|
268
|
+
}
|
|
269
|
+
async close() {
|
|
270
|
+
await this.pongoClient.close();
|
|
271
|
+
}
|
|
272
|
+
db(dbName) {
|
|
273
|
+
return new Db(this.pongoClient.db(dbName));
|
|
274
|
+
}
|
|
275
|
+
startSession(_options) {
|
|
276
|
+
return require_core.pongoSession();
|
|
277
|
+
}
|
|
278
|
+
async withSession(optionsOrExecutor, executor) {
|
|
279
|
+
const callback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor;
|
|
280
|
+
const session = require_core.pongoSession();
|
|
281
|
+
try {
|
|
282
|
+
return await callback(session);
|
|
283
|
+
} finally {
|
|
284
|
+
await session.endSession();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
373
287
|
};
|
|
374
288
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
exports.
|
|
289
|
+
//#endregion
|
|
290
|
+
exports.Collection = Collection;
|
|
291
|
+
exports.Db = Db;
|
|
292
|
+
exports.FindCursor = FindCursor;
|
|
293
|
+
exports.MongoClient = MongoClient;
|
|
380
294
|
//# sourceMappingURL=shim.cjs.map
|