moleculerjs / database

Advanced Database Access Service for Moleculer microservices framework
MIT License
32 stars 15 forks source link

MongoDB Adapter - InsertOne always failing in Mongo Community 4.4 #18

Closed vimalraj-a closed 1 year ago

vimalraj-a commented 2 years ago

When mongo adapter connected with local or single node mongo community 4.4 sever, insertOneResult.acknowledged is always null. We tried to set writeConcern as 'majority' still failed. But, Same code work with Mongo Atlas with 4.4 version database.

https://github.com/moleculerjs/database/blob/3010c96d5a6efe9931fc9e0f5f52cda182b3de87/src/adapters/mongodb.js#L232

Is there a way to disable the acknowledged check in insertOne and insertMany response? @icebob

devalexandre commented 2 years ago

@vimalraj-a are you using docker to run?

vimalraj-a commented 2 years ago

In production - yes, We are using docker & kubernetes

The problem is when I use it in development with single node mongo community database

icebob commented 2 years ago

Could you give a Docker compose file to reproduce the issue?

devalexandre commented 2 years ago

@vimalraj-a , show a docker-compose.yml