Skip to content

Commit

Permalink
Fix query included in database name
Browse files Browse the repository at this point in the history
  • Loading branch information
kapetan committed Dec 25, 2013
1 parent 00d7134 commit fa37e1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ forEachMethod(DRIVER_DB_PROTO, Database.prototype, function(methodName, fn) {

var connect = function(config, collections) {
var connectionString = parseConfig(config);
var dbName = (connectionString.match(/\/([^\/]+)(\?|$)/) || [])[1] || 'db';
var dbName = (connectionString.match(/\/([^\/\?]+)(\?|$)/) || [])[1] || 'db';

var ondb = thunky(function(callback) {
mongodb.Db.connect(connectionString, function(err, db) {
Expand Down

0 comments on commit fa37e1f

Please sign in to comment.