-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Connectivity
-
Labels:None
-
3
-
Not Needed
-
Iteration Vegetable
Currently we set `directConnection=true` on the connection model when we connect:
https://github.com/mongodb-js/connection-model/blob/master/lib/connect.js#L228
Using these conditions we should instead set it on the connection model by default, not only when connecting. This is to ensure that any connections using that connection model which don't use that connect method, like compass-shell or vscode playgrounds also have `directConnection=true`.
When `directConnection` is already set on the connection model we should not override it.
In mongodb node driver v4.0 this change around not setting `directConnection=true` when connecting will land. The driver 3.6.3 version prematurely added this change which was reverted in 3.6.4: https://github.com/mongodb/node-mongodb-native/commit/617d9dec5180c5f7b67bd8c944c168d4cbd27e1c
This impacts both VSCode (playground runtime) and Compass (Compass shell connection arguments).