Skip to content

Commit

Permalink
Use br-mongobd 4 rc & change use of mongo results.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Nov 23, 2022
1 parent ae3cc7e commit cbfcc2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/storage/ConfigStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export class ConfigStorage {
const record = {meta, config};
try {
const collection = this._getCollection();
const result = await collection.insertOne(record);
return result.ops[0];
await collection.insertOne(record);
return record;
} catch(e) {
if(!database.isDuplicateError(e)) {
throw e;
Expand Down Expand Up @@ -157,8 +157,8 @@ export class ConfigStorage {

const result = await collection.updateOne(
query, {$set: {config, 'meta.updated': now}});

if(result.result.n === 0) {
const n = result.upsertedCount + result.modifiedCount;
if(n === 0) {
// no records changed...
throw new BedrockError(
'Could not update configuration. ' +
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
"@bedrock/express": "^8.0.0",
"@bedrock/jsonld-document-loader": "^3.0.0",
"@bedrock/meter-usage-reporter": "^8.0.0",
"@bedrock/mongodb": "^10.0.0",
"@bedrock/mongodb": "^11.0.0",
"@bedrock/oauth2-verifier": "^1.0.0",
"@bedrock/security-context": "^7.0.0",
"@bedrock/validation": "^7.0.0",
"@bedrock/veres-one-context": "^14.0.1",
"@bedrock/zcap-storage": "^8.0.0"
"@bedrock/zcap-storage": "^9.0.0"
},
"directories": {
"lib": "./lib"
Expand Down
6 changes: 3 additions & 3 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
"@bedrock/https-agent": "^4.0.0",
"@bedrock/jsonld-document-loader": "^3.0.0",
"@bedrock/ledger-context": "^23.0.0",
"@bedrock/meter": "^5.0.0",
"@bedrock/meter": "github:digitalbazaar/bedrock-meter#use-mongo-driver-4-rc",
"@bedrock/meter-http": "^10.0.0",
"@bedrock/meter-usage-reporter": "^8.0.0",
"@bedrock/mongodb": "^10.0.0",
"@bedrock/mongodb": "github:digitalbazaar/bedrock-mongodb#mongo-driver-4-rc",
"@bedrock/oauth2-verifier": "^1.0.0",
"@bedrock/security-context": "^7.0.0",
"@bedrock/server": "^5.0.0",
"@bedrock/service-core": "file:..",
"@bedrock/test": "^8.0.5",
"@bedrock/validation": "^7.0.0",
"@bedrock/veres-one-context": "^14.0.1",
"@bedrock/zcap-storage": "^8.0.0",
"@bedrock/zcap-storage": "github:digitalbazaar/bedrock-zcap-storage#use-mongo-driver-4-rc",
"@digitalbazaar/ed25519-signature-2020": "^4.0.1",
"@digitalbazaar/ezcap": "^3.0.1",
"@digitalbazaar/http-client": "^3.2.0",
Expand Down

0 comments on commit cbfcc2a

Please sign in to comment.