Missing piece of code in "Connect to Cluster"-Example
I think there is a missing piece of code in the generated code-example to connect to the atlas-cluster via Node.js driver and X.509: The definition for "const credentials" should be
"const credentials = fs.readFileSync('<path_to_certificate>')"
instead of
"const credentials = '<path_to_certificate>'"
2
votes
![](https://secure.gravatar.com/avatar/f006970b40bd9978e8aede7f59b7f1fd?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
AdminRicha (Admin, MongoDB) commented
Hi Alexander, this code sample will work for Node.js versions 4.0+. Are you using a version older than this? If so, the code sample will change when your version is selected.
-
AdminRicha (Admin, MongoDB) commented
Hi Alexander, thank you for bringing this to our attention. We're working on a fix to this code sample now.