-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
How are you using Mongo? What version of the server and driver are you using?
Maintaining APIs that automatically detect and reorganize arguments has a lot of overhead and we should remove all cases in v5.0 of the driver. It can become particularly challenging if a new argument has the same typeof an existing one.
What is the feature/improvement you would like?
Remove code like this:
// addUser if (typeof password === 'function') { (callback = password), (password = undefined), (options = {}); } else if (typeof password !== 'string') { if (typeof options === 'function') { (callback = options), (options = password), (password = undefined); } else { (options = password), (callback = undefined), (password = undefined); } } else { if (typeof options === 'function') (callback = options), (options = {}); }