@better-auth/mongo-adapter 1.6.18 → 1.6.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.
Files changed (2) hide show
  1. package/dist/index.mjs +2 -1
  2. package/package.json +7 -6
package/dist/index.mjs CHANGED
@@ -420,7 +420,8 @@ const mongodbAdapter = (db, config) => {
420
420
  where,
421
421
  model
422
422
  });
423
- const update = { $inc: increment };
423
+ const update = {};
424
+ if (Object.keys(increment).length > 0) update.$inc = increment;
424
425
  if (set && Object.keys(set).length > 0) update.$set = set;
425
426
  return (await db.collection(model).findOneAndUpdate(clause, update, {
426
427
  session,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/mongo-adapter",
3
- "version": "1.6.18",
3
+ "version": "1.6.20",
4
4
  "description": "Mongo adapter for Better Auth",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,9 +35,9 @@
35
35
  }
36
36
  },
37
37
  "peerDependencies": {
38
- "@better-auth/utils": "0.4.1",
38
+ "@better-auth/utils": "0.4.2",
39
39
  "mongodb": "^6.0.0 || ^7.0.0",
40
- "@better-auth/core": "^1.6.18"
40
+ "@better-auth/core": "^1.6.20"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "mongodb": {
@@ -45,11 +45,11 @@
45
45
  }
46
46
  },
47
47
  "devDependencies": {
48
- "@better-auth/utils": "0.4.1",
48
+ "@better-auth/utils": "0.4.2",
49
49
  "mongodb": "^7.1.0",
50
50
  "tsdown": "0.21.1",
51
51
  "typescript": "^5.9.3",
52
- "@better-auth/core": "1.6.18"
52
+ "@better-auth/core": "1.6.20"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsdown",
@@ -57,6 +57,7 @@
57
57
  "lint:package": "publint run --strict --pack false",
58
58
  "lint:types": "attw --profile esm-only --pack .",
59
59
  "typecheck": "tsc --noEmit",
60
- "test": "vitest"
60
+ "test": "vitest",
61
+ "coverage": "vitest run --coverage --coverage.provider=istanbul"
61
62
  }
62
63
  }