@event-driven-io/pongo 0.17.0-beta.4 → 0.17.0-beta.40
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 -487
- 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 -487
- package/dist/cli.js.map +1 -1
- package/dist/cloudflare.cjs +41 -0
- package/dist/cloudflare.cjs.map +1 -0
- package/dist/cloudflare.d.cts +12 -0
- package/dist/cloudflare.d.ts +12 -0
- package/dist/cloudflare.js +35 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/core-BHdOCUrr.js +1429 -0
- package/dist/core-BHdOCUrr.js.map +1 -0
- package/dist/core-C9SB3XMx.cjs +1717 -0
- package/dist/core-C9SB3XMx.cjs.map +1 -0
- package/dist/core-CH0SOCr3.js +361 -0
- package/dist/core-CH0SOCr3.js.map +1 -0
- package/dist/core-CkmE5dkK.cjs +373 -0
- package/dist/core-CkmE5dkK.cjs.map +1 -0
- package/dist/index-C3pnS1S_.d.cts +720 -0
- package/dist/index-CZOmOsQt.d.ts +10 -0
- package/dist/index-FXnldVnn.d.cts +10 -0
- package/dist/index-r7V4paf_.d.ts +720 -0
- package/dist/index.cjs +67 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -105
- package/dist/index.d.ts +16 -105
- package/dist/index.js +17 -73
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +319 -288
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +29 -25
- package/dist/pg.d.ts +29 -25
- package/dist/pg.js +309 -284
- package/dist/pg.js.map +1 -1
- package/dist/shim.cjs +291 -368
- package/dist/shim.cjs.map +1 -1
- package/dist/shim.d.cts +141 -137
- package/dist/shim.d.ts +141 -137
- package/dist/shim.js +285 -367
- package/dist/shim.js.map +1 -1
- package/dist/sqlite3.cjs +43 -62
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +12 -11
- package/dist/sqlite3.d.ts +12 -11
- package/dist/sqlite3.js +36 -61
- package/dist/sqlite3.js.map +1 -1
- package/package.json +42 -44
- package/dist/chunk-4BL6YWLW.cjs +0 -872
- package/dist/chunk-4BL6YWLW.cjs.map +0 -1
- package/dist/chunk-ECQ2CKZE.cjs +0 -330
- package/dist/chunk-ECQ2CKZE.cjs.map +0 -1
- package/dist/chunk-NCNRRYVE.js +0 -872
- package/dist/chunk-NCNRRYVE.js.map +0 -1
- package/dist/chunk-Y7LRKJLJ.js +0 -330
- package/dist/chunk-Y7LRKJLJ.js.map +0 -1
- package/dist/d1.cjs +0 -53
- package/dist/d1.cjs.map +0 -1
- package/dist/d1.d.cts +0 -11
- package/dist/d1.d.ts +0 -11
- package/dist/d1.js +0 -53
- package/dist/d1.js.map +0 -1
- package/dist/index-BJopB-em.d.cts +0 -7
- package/dist/index-G5DECNb_.d.ts +0 -7
- package/dist/pongoCollectionSchemaComponent-t_e9n2Wc.d.cts +0 -426
- package/dist/pongoCollectionSchemaComponent-t_e9n2Wc.d.ts +0 -426
package/dist/shim.cjs
CHANGED
|
@@ -1,381 +1,304 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_core = require('./core-C9SB3XMx.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
|
-
require('http2');
|
|
44
|
-
|
|
45
|
-
// src/mongo/mongoDb.ts
|
|
46
|
-
require('mongodb');
|
|
47
|
-
|
|
48
|
-
// src/mongo/mongoCollection.ts
|
|
49
|
-
var toCollectionOperationOptions = (options) => _optionalChain([options, 'optionalAccess', _ => _.session]) ? { session: options.session } : void 0;
|
|
50
|
-
var toFindOptions = (options) => {
|
|
51
|
-
if (!_optionalChain([options, 'optionalAccess', _2 => _2.session]) && !_optionalChain([options, 'optionalAccess', _3 => _3.limit]) && !_optionalChain([options, 'optionalAccess', _4 => _4.skip])) {
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
const pongoFindOptions = {};
|
|
55
|
-
if (_optionalChain([options, 'optionalAccess', _5 => _5.session])) {
|
|
56
|
-
pongoFindOptions.session = options.session;
|
|
57
|
-
}
|
|
58
|
-
if (_optionalChain([options, 'optionalAccess', _6 => _6.limit]) !== void 0) {
|
|
59
|
-
pongoFindOptions.limit = options.limit;
|
|
60
|
-
}
|
|
61
|
-
if (_optionalChain([options, 'optionalAccess', _7 => _7.skip]) !== void 0) {
|
|
62
|
-
pongoFindOptions.skip = options.skip;
|
|
63
|
-
}
|
|
64
|
-
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;
|
|
65
47
|
};
|
|
66
48
|
var Collection = class {
|
|
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
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return this.collection.findOneAndReplace(
|
|
259
|
-
filter,
|
|
260
|
-
replacement,
|
|
261
|
-
toCollectionOperationOptions(options)
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
findOneAndUpdate(filter, update, options) {
|
|
265
|
-
return this.collection.findOneAndUpdate(
|
|
266
|
-
filter,
|
|
267
|
-
update,
|
|
268
|
-
toCollectionOperationOptions(options)
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
aggregate(_pipeline, _options) {
|
|
272
|
-
throw new Error("Method not implemented.");
|
|
273
|
-
}
|
|
274
|
-
watch(_pipeline, _options) {
|
|
275
|
-
throw new Error("Method not implemented.");
|
|
276
|
-
}
|
|
277
|
-
initializeUnorderedBulkOp(_options) {
|
|
278
|
-
throw new Error("Method not implemented.");
|
|
279
|
-
}
|
|
280
|
-
initializeOrderedBulkOp(_options) {
|
|
281
|
-
throw new Error("Method not implemented.");
|
|
282
|
-
}
|
|
283
|
-
count(filter, options) {
|
|
284
|
-
return this.collection.countDocuments(
|
|
285
|
-
_nullishCoalesce(filter, () => ( {})),
|
|
286
|
-
toCollectionOperationOptions(options)
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
listSearchIndexes(_name, _options) {
|
|
290
|
-
throw new Error("Method not implemented.");
|
|
291
|
-
}
|
|
292
|
-
createSearchIndex(_description) {
|
|
293
|
-
throw new Error("Method not implemented.");
|
|
294
|
-
}
|
|
295
|
-
createSearchIndexes(_descriptions) {
|
|
296
|
-
throw new Error("Method not implemented.");
|
|
297
|
-
}
|
|
298
|
-
dropSearchIndex(_name) {
|
|
299
|
-
throw new Error("Method not implemented.");
|
|
300
|
-
}
|
|
301
|
-
updateSearchIndex(_name, _definition) {
|
|
302
|
-
throw new Error("Method not implemented.");
|
|
303
|
-
}
|
|
304
|
-
async createCollection() {
|
|
305
|
-
await this.collection.createCollection();
|
|
306
|
-
}
|
|
307
|
-
async handle(id, handle, options) {
|
|
308
|
-
return this.collection.handle(id.toString(), handle, options);
|
|
309
|
-
}
|
|
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.matchedCount,
|
|
101
|
+
modifiedCount: result.modifiedCount,
|
|
102
|
+
upsertedCount: result.upsertedCount,
|
|
103
|
+
upsertedId: result.upsertedId
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
async replaceOne(filter, document, options) {
|
|
107
|
+
const result = await this.collection.replaceOne(filter, document, {
|
|
108
|
+
...toCollectionOperationOptions(options),
|
|
109
|
+
upsert: options?.upsert ?? false
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
acknowledged: result.acknowledged,
|
|
113
|
+
matchedCount: result.matchedCount,
|
|
114
|
+
modifiedCount: result.modifiedCount,
|
|
115
|
+
upsertedCount: result.upsertedCount,
|
|
116
|
+
upsertedId: result.upsertedId
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async updateMany(filter, update, options) {
|
|
120
|
+
const result = await this.collection.updateMany(filter, update, toCollectionOperationOptions(options));
|
|
121
|
+
return {
|
|
122
|
+
acknowledged: result.acknowledged,
|
|
123
|
+
matchedCount: result.matchedCount,
|
|
124
|
+
modifiedCount: result.modifiedCount,
|
|
125
|
+
upsertedCount: 0,
|
|
126
|
+
upsertedId: null
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
async deleteOne(filter, options) {
|
|
130
|
+
const result = await this.collection.deleteOne(filter, toCollectionOperationOptions(options));
|
|
131
|
+
return {
|
|
132
|
+
acknowledged: result.acknowledged,
|
|
133
|
+
deletedCount: result.deletedCount
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
async deleteMany(filter, options) {
|
|
137
|
+
const result = await this.collection.deleteMany(filter, toCollectionOperationOptions(options));
|
|
138
|
+
return {
|
|
139
|
+
acknowledged: result.acknowledged,
|
|
140
|
+
deletedCount: result.deletedCount
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
async rename(newName, options) {
|
|
144
|
+
await this.collection.rename(newName, toCollectionOperationOptions(options));
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
drop(options) {
|
|
148
|
+
return this.collection.drop(toCollectionOperationOptions(options));
|
|
149
|
+
}
|
|
150
|
+
async findOne(filter, options) {
|
|
151
|
+
return await this.collection.findOne(filter, toCollectionOperationOptions(options));
|
|
152
|
+
}
|
|
153
|
+
find(filter, options) {
|
|
154
|
+
return new FindCursor(this.collection.find(filter, toFindOptions(options)));
|
|
155
|
+
}
|
|
156
|
+
options(_options) {
|
|
157
|
+
throw new Error("Method not implemented.");
|
|
158
|
+
}
|
|
159
|
+
isCapped(_options) {
|
|
160
|
+
throw new Error("Method not implemented.");
|
|
161
|
+
}
|
|
162
|
+
createIndex(_indexSpec, _options) {
|
|
163
|
+
throw new Error("Method not implemented.");
|
|
164
|
+
}
|
|
165
|
+
createIndexes(_indexSpecs, _options) {
|
|
166
|
+
throw new Error("Method not implemented.");
|
|
167
|
+
}
|
|
168
|
+
dropIndex(_indexName, _options) {
|
|
169
|
+
throw new Error("Method not implemented.");
|
|
170
|
+
}
|
|
171
|
+
dropIndexes(_options) {
|
|
172
|
+
throw new Error("Method not implemented.");
|
|
173
|
+
}
|
|
174
|
+
listIndexes(_options) {
|
|
175
|
+
throw new Error("Method not implemented.");
|
|
176
|
+
}
|
|
177
|
+
indexExists(_indexes, _options) {
|
|
178
|
+
throw new Error("Method not implemented.");
|
|
179
|
+
}
|
|
180
|
+
indexInformation(_options) {
|
|
181
|
+
throw new Error("Method not implemented.");
|
|
182
|
+
}
|
|
183
|
+
estimatedDocumentCount(options) {
|
|
184
|
+
return this.collection.countDocuments({}, toCollectionOperationOptions(options));
|
|
185
|
+
}
|
|
186
|
+
countDocuments(filter, options) {
|
|
187
|
+
return this.collection.countDocuments(filter, toCollectionOperationOptions(options));
|
|
188
|
+
}
|
|
189
|
+
distinct(_key, _filter, _options) {
|
|
190
|
+
throw new Error("Method not implemented.");
|
|
191
|
+
}
|
|
192
|
+
indexes(_options) {
|
|
193
|
+
throw new Error("Method not implemented.");
|
|
194
|
+
}
|
|
195
|
+
findOneAndDelete(filter, options) {
|
|
196
|
+
return this.collection.findOneAndDelete(filter, toCollectionOperationOptions(options));
|
|
197
|
+
}
|
|
198
|
+
findOneAndReplace(filter, replacement, options) {
|
|
199
|
+
return this.collection.findOneAndReplace(filter, replacement, toCollectionOperationOptions(options));
|
|
200
|
+
}
|
|
201
|
+
findOneAndUpdate(filter, update, options) {
|
|
202
|
+
return this.collection.findOneAndUpdate(filter, update, toCollectionOperationOptions(options));
|
|
203
|
+
}
|
|
204
|
+
aggregate(_pipeline, _options) {
|
|
205
|
+
throw new Error("Method not implemented.");
|
|
206
|
+
}
|
|
207
|
+
watch(_pipeline, _options) {
|
|
208
|
+
throw new Error("Method not implemented.");
|
|
209
|
+
}
|
|
210
|
+
initializeUnorderedBulkOp(_options) {
|
|
211
|
+
throw new Error("Method not implemented.");
|
|
212
|
+
}
|
|
213
|
+
initializeOrderedBulkOp(_options) {
|
|
214
|
+
throw new Error("Method not implemented.");
|
|
215
|
+
}
|
|
216
|
+
count(filter, options) {
|
|
217
|
+
return this.collection.countDocuments(filter ?? {}, toCollectionOperationOptions(options));
|
|
218
|
+
}
|
|
219
|
+
listSearchIndexes(_name, _options) {
|
|
220
|
+
throw new Error("Method not implemented.");
|
|
221
|
+
}
|
|
222
|
+
createSearchIndex(_description) {
|
|
223
|
+
throw new Error("Method not implemented.");
|
|
224
|
+
}
|
|
225
|
+
createSearchIndexes(_descriptions) {
|
|
226
|
+
throw new Error("Method not implemented.");
|
|
227
|
+
}
|
|
228
|
+
dropSearchIndex(_name) {
|
|
229
|
+
throw new Error("Method not implemented.");
|
|
230
|
+
}
|
|
231
|
+
updateSearchIndex(_name, _definition) {
|
|
232
|
+
throw new Error("Method not implemented.");
|
|
233
|
+
}
|
|
234
|
+
async createCollection() {
|
|
235
|
+
await this.collection.createCollection();
|
|
236
|
+
}
|
|
237
|
+
async handle(id, handle, options) {
|
|
238
|
+
return this.collection.handle(id.toString(), handle, options);
|
|
239
|
+
}
|
|
310
240
|
};
|
|
311
241
|
|
|
312
|
-
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/mongo/mongoDb.ts
|
|
313
244
|
var Db = class {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
245
|
+
pongoDb;
|
|
246
|
+
constructor(pongoDb) {
|
|
247
|
+
this.pongoDb = pongoDb;
|
|
248
|
+
}
|
|
249
|
+
get databaseName() {
|
|
250
|
+
return this.pongoDb.databaseName;
|
|
251
|
+
}
|
|
252
|
+
collection(collectionName, options) {
|
|
253
|
+
return new Collection(this, this.pongoDb.collection(collectionName, options));
|
|
254
|
+
}
|
|
324
255
|
};
|
|
325
256
|
|
|
326
|
-
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/mongo/mongoClient.ts
|
|
327
259
|
var MongoClient = class {
|
|
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
|
-
|
|
365
|
-
async withSession(optionsOrExecutor, executor) {
|
|
366
|
-
const callback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor;
|
|
367
|
-
const session = _chunk4BL6YWLWcjs.pongoSession.call(void 0, );
|
|
368
|
-
try {
|
|
369
|
-
return await callback(session);
|
|
370
|
-
} finally {
|
|
371
|
-
await session.endSession();
|
|
372
|
-
}
|
|
373
|
-
}
|
|
260
|
+
pongoClient;
|
|
261
|
+
constructor(connectionStringOrOptions, options) {
|
|
262
|
+
if (typeof connectionStringOrOptions !== "string") {
|
|
263
|
+
this.pongoClient = require_core.pongoClient(connectionStringOrOptions);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const { databaseType, driverName } = (0, _event_driven_io_dumbo.parseConnectionString)(connectionStringOrOptions);
|
|
267
|
+
const driver = options?.driver ?? pongoDriverRegistry.tryGet((0, _event_driven_io_dumbo.toDatabaseDriverType)(databaseType, driverName));
|
|
268
|
+
if (driver === null) throw new Error(`No database driver registered for ${databaseType} with name ${driverName}`);
|
|
269
|
+
this.pongoClient = require_core.pongoClient({
|
|
270
|
+
...options ?? {},
|
|
271
|
+
connectionString: connectionStringOrOptions,
|
|
272
|
+
driver
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
async connect() {
|
|
276
|
+
await this.pongoClient.connect();
|
|
277
|
+
return this;
|
|
278
|
+
}
|
|
279
|
+
async close() {
|
|
280
|
+
await this.pongoClient.close();
|
|
281
|
+
}
|
|
282
|
+
db(dbName) {
|
|
283
|
+
return new Db(this.pongoClient.db(dbName));
|
|
284
|
+
}
|
|
285
|
+
startSession(_options) {
|
|
286
|
+
return require_core.pongoSession();
|
|
287
|
+
}
|
|
288
|
+
async withSession(optionsOrExecutor, executor) {
|
|
289
|
+
const callback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor;
|
|
290
|
+
const session = require_core.pongoSession();
|
|
291
|
+
try {
|
|
292
|
+
return await callback(session);
|
|
293
|
+
} finally {
|
|
294
|
+
await session.endSession();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
374
297
|
};
|
|
375
298
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
exports.
|
|
299
|
+
//#endregion
|
|
300
|
+
exports.Collection = Collection;
|
|
301
|
+
exports.Db = Db;
|
|
302
|
+
exports.FindCursor = FindCursor;
|
|
303
|
+
exports.MongoClient = MongoClient;
|
|
381
304
|
//# sourceMappingURL=shim.cjs.map
|