Use Connection String :
mongodb://username:password@localhost:27017/mydatabase?authSource=admin&authMechanism=SCRAM-SHA-256
References
https://www.mongodb.com/docs/manual/reference/connection-string/
Daily Notes of a Programmer
Use Connection String :
mongodb://username:password@localhost:27017/mydatabase?authSource=admin&authMechanism=SCRAM-SHA-256
References
https://www.mongodb.com/docs/manual/reference/connection-string/