Skip to content

Commit 8451585

Browse files
committed
Use result.*Count to enable newer mongodb driver versions.
1 parent 928bbfe commit 8451585

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# bedrock-vc-status ChangeLog
22

3+
## 1.1.1 - 2025-mm-dd
4+
5+
### Fixed
6+
- Use `result.modifiedCount` to enable newer mongodb driver.
7+
38
## 1.1.0 - 2025-02-27
49

510
### Changed

lib/mappings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as bedrock from '@bedrock/core';
55
import * as database from '@bedrock/mongodb';
@@ -76,7 +76,7 @@ export async function set({
7676
}
7777
}, {upsert: true});
7878

79-
if(result.result.n > 0) {
79+
if(result.modifiedCount > 0 || result.upsertedCount > 0) {
8080
// document upserted or modified
8181
return true;
8282
}

lib/slcs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as bedrock from '@bedrock/core';
55
import * as database from '@bedrock/mongodb';
@@ -155,7 +155,7 @@ export async function set({
155155
$setOnInsert: {statusListId, indexAllocator, 'meta.created': now}
156156
}, {upsert: true});
157157

158-
if(result.result.n > 0) {
158+
if(result.modifiedCount > 0 || result.upsertedCount > 0) {
159159
// document upserted or modified: success; clear cache
160160
SLC_CACHE.delete(statusListId);
161161
return true;

0 commit comments

Comments
 (0)