@better-auth/mongo-adapter 1.6.16 → 1.6.18
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.mjs +13 -0
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -414,6 +414,19 @@ const mongodbAdapter = (db, config) => {
|
|
|
414
414
|
session,
|
|
415
415
|
includeResultMetadata: true
|
|
416
416
|
}))?.value ?? null;
|
|
417
|
+
},
|
|
418
|
+
async incrementOne({ model, where, increment, set }) {
|
|
419
|
+
const clause = convertWhereClause({
|
|
420
|
+
where,
|
|
421
|
+
model
|
|
422
|
+
});
|
|
423
|
+
const update = { $inc: increment };
|
|
424
|
+
if (set && Object.keys(set).length > 0) update.$set = set;
|
|
425
|
+
return (await db.collection(model).findOneAndUpdate(clause, update, {
|
|
426
|
+
session,
|
|
427
|
+
returnDocument: "after",
|
|
428
|
+
includeResultMetadata: true
|
|
429
|
+
}))?.value ?? null;
|
|
417
430
|
}
|
|
418
431
|
};
|
|
419
432
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/mongo-adapter",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.18",
|
|
4
4
|
"description": "Mongo adapter for Better Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@better-auth/utils": "0.4.1",
|
|
39
39
|
"mongodb": "^6.0.0 || ^7.0.0",
|
|
40
|
-
"@better-auth/core": "^1.6.
|
|
40
|
+
"@better-auth/core": "^1.6.18"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"mongodb": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"mongodb": "^7.1.0",
|
|
50
50
|
"tsdown": "0.21.1",
|
|
51
51
|
"typescript": "^5.9.3",
|
|
52
|
-
"@better-auth/core": "1.6.
|
|
52
|
+
"@better-auth/core": "1.6.18"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsdown",
|