Skip to content

Commit

Permalink
fix(collection): ensure dynamic require of db is wrapped in parenth…
Browse files Browse the repository at this point in the history
…eses

This is a fix for issue webpack/webpack#6191
Needed to surround the require statement with parenthesis to make its priority higher.
  • Loading branch information
bojidaryovchev authored and mbroadst committed Jan 16, 2018
1 parent 63b9d62 commit efa78f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3001,7 +3001,7 @@ var mapReduce = function(self, map, reduce, options, callback) {
if (result.result != null && typeof result.result === 'object') {
var doc = result.result;
// Return a collection from another db
collection = new require('./db')(
collection = new (require('./db'))(
doc.db,
self.s.db.s.topology,
self.s.db.s.options
Expand Down

0 comments on commit efa78f0

Please sign in to comment.