From cb9d915b6a55dd4e5e0a9b4645f74dbfeee2c64a Mon Sep 17 00:00:00 2001 From: Dan Aprahamian Date: Thu, 2 Aug 2018 16:15:29 -0400 Subject: [PATCH] docs(connect): remove references to MongoClient.connect We want to encourage people to manually create a new MongoClient, and then call connect, instead of using the static method MongoClient.connect Fixes NODE-1585 --- .../content/quick-start/quick-start.md | 21 +++--- .../connecting/connection-settings.md | 13 ++-- .../reference/ecmascriptnext/connecting.md | 10 ++- .../content/reference/ecmascriptnext/crud.md | 44 ++++++------ docs/reference/content/reference/faq/index.md | 9 +-- .../content/reference/management/logging.md | 15 +++-- .../tutorials/connect/authenticating.md | 59 +++++++++------- .../content/tutorials/connect/index.md | 21 +++--- .../content/tutorials/connect/ssl.md | 67 +++++++++++-------- .../content/tutorials/gridfs/streaming.md | 7 +- .../layouts/shortcodes/basic-connection.html | 7 +- .../shortcodes/connect-to-replicaset.html | 5 +- .../connect-to-sharded-cluster.html | 5 +- .../layouts/shortcodes/find-documents.html | 4 +- .../layouts/shortcodes/js6-connect.html | 4 +- .../layouts/shortcodes/myproject-connect.html | 5 +- 16 files changed, 174 insertions(+), 122 deletions(-) diff --git a/docs/reference/content/quick-start/quick-start.md b/docs/reference/content/quick-start/quick-start.md index a4b85c0767..89c7e5adfe 100644 --- a/docs/reference/content/quick-start/quick-start.md +++ b/docs/reference/content/quick-start/quick-start.md @@ -106,9 +106,10 @@ const url = 'mongodb://localhost:27017'; // Database Name const dbName = 'myproject'; +const client = new MongoClient(url); // Use connect method to connect to the server -MongoClient.connect(url, function(err, client) { +client.connect(url, function(err) { assert.equal(null, err); console.log("Connected successfully to server"); @@ -156,7 +157,7 @@ rather than from within a browser console, and console.log returns better format --> -This query returns all the documents in the **documents** collection. Add the **findDocument** method to the **MongoClient.connect** callback: +This query returns all the documents in the **documents** collection. Add the **findDocument** method to the **client.connect** callback: