We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 861761e commit 52b6039Copy full SHA for 52b6039
lib/url_parser.js
@@ -8,6 +8,9 @@ var ReadPreference = require('./read_preference'),
8
dns = require('dns');
9
10
module.exports = function(url, options, callback) {
11
+ if (typeof options === 'function') (callback = options), (options = {});
12
+ options = options || {};
13
+
14
var result = parser.parse(url, true);
15
if (result.protocol !== 'mongodb:' && result.protocol !== 'mongodb+srv:') {
16
return callback(new Error('invalid schema, expected mongodb or mongodb+srv'));
0 commit comments