Skip to content

Commit

Permalink
feat: upgrade mongodb to 5.0
Browse files Browse the repository at this point in the history
Signed-off-by: vanpho93 <vanpho02@gmail.com>
  • Loading branch information
vanpho93 committed Jan 3, 2023
1 parent 61424f1 commit 0b4b338
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-balloons-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@reactioncommerce/api-core": minor
---

feat: upgrade mongodb to verion 5.0
2 changes: 1 addition & 1 deletion docker-compose.circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
- "3000:3000"

mongo:
image: mongo:4.2.0
image: mongo:5.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
networks:
- default
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.4"

services:
mongo:
image: mongo:4.2.0
image: mongo:5.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
networks:
default:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ networks:

services:
api:
image: reactioncommerce/reaction:4.2.0
image: reactioncommerce/reaction:4.2.7
depends_on:
- mongo
env_file:
Expand All @@ -25,7 +25,7 @@ services:
- "3000:3000"

mongo:
image: mongo:4.2.0
image: mongo:5.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
networks:
- default
Expand Down
3 changes: 2 additions & 1 deletion packages/api-core/src/ReactionAPICore.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,9 @@ export default class ReactionAPICore {
const prevInsertOne = collection.insertOne.bind(collection);
collection.insertOne = (async (...args) => {
const response = await prevInsertOne(...args);
const insertedCount = response.acknowledged ? 1 : 0;
// eslint-disable-next-line id-length
return { ...response, result: { n: response.acknowledged ? 1 : 0, ok: acknowledgedToOk(response.acknowledged) } };
return { ...response, insertedCount, result: { n: insertedCount, ok: acknowledgedToOk(response.acknowledged) } };
}).bind(collection);

const prevFindOneAndUpdate = collection.findOneAndUpdate.bind(collection);
Expand Down

0 comments on commit 0b4b338

Please sign in to comment.