Upgrading to new Version, under Docker

We’re using Docker, and docker compose with the GitHub genieacs-docker/blob/master/docker-compose.yml.

Genie upgrades seamlessly, but MongoDB needs a tweak for new versions, considering that you want to preserve the db contents. See featureCompatibilityVersion. Firstly, Mongo versions need to be upgraded sequentially, one major version at a time. Secondly, you have to update the compatibility value in the db before upgrading to the next version.
Assuming running containers after docker compose up -d

docker exec -it mongo bash
> mongod --version
> mongosh
  db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )
> exit

Then update docker-compose.yml with the new version and restart the container.

        image: mongo:7.0