Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade mongodb to 5.0 #6739

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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