Details
-
Improvement
-
Resolution: Fixed
-
Major - P3
-
None
Description
Description
I noticed that a few pages were referring to the 2.x version of the Node Driver. For example:
- https://docs.mongodb.com/manual/tutorial/getting-started/ links to http://mongodb.github.io/node-mongodb-native/2.2/ instead of http://mongodb.github.io/node-mongodb-native/3.2/
- https://docs.mongodb.com/manual/tutorial/atlas-free-tier-setup/#connect-to-the-cluster uses the following code:
var MongoClient = require('mongodb').MongoClient;
|
|
|
var uri = "mongodb://user123:p455w0rd@gettingstarted-shard-00-00-hyjsm.mongodb.net:27017,gettingstarted-shard-00-01-hyjsm.mongodb.net:27017,gettingstarted-shard-00-02-hyjsm.mongodb.net:27017/test?ssl=true&replicaSet=GettingStarted-shard-0&authSource=admin";
|
MongoClient.connect(uri, function(err, db) {
|
// Paste the following examples here
|
|
|
db.close();
|
});
|
For the 3.x version of the driver, it should look more like:
const { MongoClient } = require('mongodb');
|
|
|
const uri = "mongodb://user123:p455w0rd@gettingstarted-shard-00-00-hyjsm.mongodb.net:27017,gettingstarted-shard-00-01-hyjsm.mongodb.net:27017,gettingstarted-shard-00-02-hyjsm.mongodb.net:27017/test?ssl=true&replicaSet=GettingStarted-shard-0&authSource=admin";
|
|
|
const client = new MongoClient(uri);
|
client.connect().then(async function() {
|
// Paste the following examples here
|
|
|
await client.close();
|
});
|
A/C
- All links in getting started page (https://docs.mongodb.com/manual/tutorial/getting-started/), should point to 3.x version of that link
- In https://docs.mongodb.com/manual/tutorial/atlas-free-tier-setup/#connect-to-the-cluster > Node tab > Connect to Cluster > code should be for 3.x version of the driver as stated above