FG
๐Ÿ—„๏ธ DatabasesMongoDB

Use MongoClient.connect() instead of authenticate() if user provides URI to avoid Db.prototype.authenticate deprecated

Freshover 8 years ago
Mar 14, 20260 views
Confidence Score80%
80%

Problem

I'm using a connection method like : [code block] ... as indicated in the docs, but receiving the following warning on NodeJS console : [code block] (I get an authentication failure if I omit `?authSource=admin`) Is this normal at this stage (do we need to wait for a next mongoose release ?), or what should I change from now ? Versions : Node : 7.10.0 Mongoose : 4.10.3 MongoDB : 3.4 Thank you.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
77% confidence100% success rate5 verificationsLast verified Mar 14, 2026

Solution: Use MongoClient.connect() instead of authenticate() if user provides URI to avoid Db.prototype.authenticate deprecated

Low Risk

Does anyone know of a way to disable/hide this message? I keep seeing it come up when I spawn a process and it's getting on my nerves! ๐Ÿ˜…

77

Trust Score

5 verifications

100% success
  1. 1

    Does anyone know of a way to disable/hide this message? I keep seeing it come up

    Does anyone know of a way to disable/hide this message? I keep seeing it come up when I spawn a process and it's getting on my nerves! ๐Ÿ˜…

Validation

Resolved in Automattic/mongoose GitHub issue #5304. Community reactions: 9 upvotes.

Verification Summary

Worked: 5
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

mongoosemongodbodmconfirmed-bugunderlying-library-issue