@andrew_l/mongo-transaction 0.2.18 → 0.2.20
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/README.md +8 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Mongo Transaction Toolkit
|
|
2
2
|
|
|
3
|
-

|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
![license][license-src]
|
|
6
5
|
|
|
7
6
|
This package solves a common issue with MongoDB's `session.withTransaction`, where the provided function might be executed multiple times due to retries. This can create challenges for managing side effects that need to be rolled back consistently during transaction retries or failures.
|
|
8
7
|
|
|
@@ -93,3 +92,9 @@ confirmOrder('673b907dddd8ae43262aec0d').catch(console.error);
|
|
|
93
92
|
1. **Safe Retries:** MongoDB retries can cause duplicate actions if not handled properly. This package ensures all side effects are idempotent and reversible.
|
|
94
93
|
2. **Streamlined Rollbacks:** Simplifies managing complex operations by integrating rollback mechanisms into your transaction workflow.
|
|
95
94
|
3. **Ease of Use:** API design mimics React's hooks, making it intuitive for developers familiar with React patterns.
|
|
95
|
+
|
|
96
|
+
<!-- Badges -->
|
|
97
|
+
|
|
98
|
+
[npm-version-src]: https://img.shields.io/npm/v/@andrew_l/mongo-transaction?style=flat
|
|
99
|
+
[npm-version-href]: https://npmjs.com/package/@andrew_l/mongo-transaction
|
|
100
|
+
[license-src]: https://img.shields.io/npm/l/@andrew_l/mongo-transaction?style=flat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrew_l/mongo-transaction",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"description": "Manages side effects in MongoDB transactions, rollback on failure and preventing duplicates on retries.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"vitest": "^2.1.3"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@andrew_l/context": "0.2.
|
|
42
|
-
"@andrew_l/toolkit": "0.2.
|
|
41
|
+
"@andrew_l/context": "0.2.20",
|
|
42
|
+
"@andrew_l/toolkit": "0.2.20"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"mongodb": "^5 || ^6"
|