-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Native
-
None
Presently operations live in the code right next to wherever they are being used (e.g. Collection.prototype.createIndex and createIndex in that same file). This not only leads to a decrease in readability of these (already large) files, but also an inability to share code in these operations between methods. The problem with not being able to share these is that we currently have operations that need to use other operations (e.g. https://github.com/mongodb/node-mongodb-native/blob/3.0.0/lib/collection.js#L1387), and in these cases we now have a heavyweight chain of calls to `executeOperation` which incurs non-trivial overhead. Instead these operations should be moved to their own file(s), and allowed to be shared as "private implementation" of the driver.