Deprecation Warning - Current Server Discovery and Monitoring engine is deprecated

I’m seeing this warning only in production:

DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Use `node --trace-deprecation ...` to show where the warning was created)

I’m running Meteor 2.3.4. My understaning is that useUnifiedTopology was set to true by default in v2.2 Meteor Changelog | Meteor API Docs.

I also tried to set it in Meteor.settings:

 "packages": {
    "mongo": {
      "options": {
        "useUnifiedTopology": true

I’m building with this Dockerfile:

# The tag here should match the Meteor version of your app, per .meteor/release
FROM geoffreybooth/meteor-base:2.3.4

# Copy app package.json and package-lock.json into container
COPY ./package*.json $APP_SOURCE_FOLDER/


# Copy app source into container


# Use the specific version of Node expected by your Meteor release, per
FROM node:14.17.4-alpine


# Install OS build dependencies, which we remove later after we’ve compiled native Node extensions
RUN apk --no-cache --virtual .node-gyp-compilation-dependencies add \
    g++ \
    make \
    python \
  # And runtime dependencies, which we keep
  && apk --no-cache add \
    bash \

# Copy in entrypoint

# Copy in app bundle

RUN bash $SCRIPTS_FOLDER/ --build-from-source \
  && apk del .node-gyp-compilation-dependencies

# Start app
ENTRYPOINT ["/docker/"]

CMD ["node", "main.js"]

Any ideas on how to resolve?

1 Like

Hi, yes, as you can see in the code here we are always using useUnifiedTopology: true in the latest versions of Meteor.

The version of Meteor in your Dockerfile doesn’t matter, the important part is the Meteor version in your project.

You can check the version of your project in your .meteor/release file or running meteor --version.

Or maybe you are using a different way to connect to Mongo instead of Meteor Collections.