mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Prefer client.s.databaseName over client.s.options.dbName.
Fixes #9827.
The client.s.databaseName property appears to have been introduced a long
time ago (in 2014), so it seems reliable:
14fd60b99d
The use of client.s.options.dbName was only recently introduced in #9790,
since the MongoDB.connect callback now receives a MongoClient object
rather than a Db object. Not sure if client.s.options.dbName was ever
reliable, but at least we know when the problem started.
This commit is contained in:
@@ -177,7 +177,11 @@ MongoConnection = function (url, options) {
|
||||
|
||||
// Use the internal `s` object to get the database name from the
|
||||
// connection URL (parsed by the driver).
|
||||
var db = client.db(client.s.options.dbName);
|
||||
var db = client.db(
|
||||
client.s.databaseName ||
|
||||
// An older way of getting the name, supported as a fallback.
|
||||
client.s.options.dbName
|
||||
);
|
||||
|
||||
// First, figure out what the current primary is, if any.
|
||||
if (db.serverConfig.isMasterDoc) {
|
||||
|
||||
Reference in New Issue
Block a user