-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Empty show more show less
This is probably a regression due to this commit - https://github.com/mongodb/node-mongodb-native/commit/940850b891100547e94daa6b5e4b4737b6cde73b
In line 1035, this conditional check seems to be the problem.
if(err && err.code && err.code != 48 && options && options.strict) return callback(err, null);
In case of collection already exists error, there is no code being returned. Below is the error returned by the runCommand.
{ [MongoError: collection already exists] name: 'MongoError', ok: 0, errmsg: 'collection already exists' }Not sure whether err.code check is required over there (maybe some hack), but if it is something that is needed for 2.8 then it could be written as
if(err && (!err.code || err.code && err.code != 48) && options && options.strict)