@drawbridge/mongodb 0.0.2 → 0.0.3
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/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -425,11 +425,17 @@ module.exports = ({
|
|
|
425
425
|
|
|
426
426
|
const session = client.startSession();
|
|
427
427
|
|
|
428
|
+
let value;
|
|
429
|
+
|
|
428
430
|
try {
|
|
429
431
|
|
|
430
|
-
|
|
432
|
+
await session.withTransaction( async () => {
|
|
431
433
|
|
|
432
|
-
|
|
434
|
+
value = await callback( session );
|
|
435
|
+
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
return value;
|
|
433
439
|
|
|
434
440
|
} finally {
|
|
435
441
|
|
package/dist/index.d.ts
CHANGED
|
@@ -425,11 +425,17 @@ module.exports = ({
|
|
|
425
425
|
|
|
426
426
|
const session = client.startSession();
|
|
427
427
|
|
|
428
|
+
let value;
|
|
429
|
+
|
|
428
430
|
try {
|
|
429
431
|
|
|
430
|
-
|
|
432
|
+
await session.withTransaction( async () => {
|
|
431
433
|
|
|
432
|
-
|
|
434
|
+
value = await callback( session );
|
|
435
|
+
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
return value;
|
|
433
439
|
|
|
434
440
|
} finally {
|
|
435
441
|
|
package/dist/index.js
CHANGED
|
@@ -307,9 +307,12 @@ module.exports = ({
|
|
|
307
307
|
},
|
|
308
308
|
transaction: async (callback) => {
|
|
309
309
|
const session = client.startSession();
|
|
310
|
+
let value;
|
|
310
311
|
try {
|
|
311
|
-
|
|
312
|
-
|
|
312
|
+
await session.withTransaction(async () => {
|
|
313
|
+
value = await callback(session);
|
|
314
|
+
});
|
|
315
|
+
return value;
|
|
313
316
|
} finally {
|
|
314
317
|
await session.endSession();
|
|
315
318
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -320,9 +320,12 @@ var require_index = __commonJS({
|
|
|
320
320
|
},
|
|
321
321
|
transaction: async (callback) => {
|
|
322
322
|
const session = client.startSession();
|
|
323
|
+
let value;
|
|
323
324
|
try {
|
|
324
|
-
|
|
325
|
-
|
|
325
|
+
await session.withTransaction(async () => {
|
|
326
|
+
value = await callback(session);
|
|
327
|
+
});
|
|
328
|
+
return value;
|
|
326
329
|
} finally {
|
|
327
330
|
await session.endSession();
|
|
328
331
|
}
|