diff --git a/source/code-snippets/usage-examples/bulkWrite.js b/source/code-snippets/usage-examples/bulkWrite.js index 5fc52d423..412abcf99 100644 --- a/source/code-snippets/usage-examples/bulkWrite.js +++ b/source/code-snippets/usage-examples/bulkWrite.js @@ -3,7 +3,7 @@ // Import MongoClient from the MongoDB node driver package const { MongoClient } = require("mongodb"); -// Replace the uri string with your MongoDB deployment's connection string +// Replace the uri string with your MongoDB deployment's connection string. const uri = ""; const client = new MongoClient(uri); @@ -13,7 +13,6 @@ async function run() { const database = client.db("sample_mflix"); const theaters = database.collection("theaters"); - // Insert a new document into the "theaters" collection const result = await theaters.bulkWrite([ { insertOne: { @@ -44,7 +43,6 @@ async function run() { }, }, { - // Update documents that match the specified filter updateMany: { filter: { "location.address.zipcode": "44011" }, update: { $set: { is_in_ohio: true } }, @@ -52,14 +50,12 @@ async function run() { }, }, { - // Delete a document that matches the specified filter deleteOne: { filter: { "location.address.street1": "221b Baker St" } }, }, ]); - // Log the result of the bulk write operation + console.log(result); } finally { - // Close the database connection when the operations are completed or if an error occurs await client.close(); } } diff --git a/source/faq.txt b/source/faq.txt index 9a627c064..49e8bf0e6 100644 --- a/source/faq.txt +++ b/source/faq.txt @@ -123,11 +123,9 @@ What Is the Difference Between "connectTimeoutMS", "socketTimeoutMS" and "maxTim for an individual connection from your connection pool to establish a TCP connection to the {+mdb-server+} before timing out. - - .. tip:: - - To modify the allowed time for `MongoClient.connect <{+api+}/classes/MongoClient.html#connect>`__ to establish a - connection to a {+mdb-server+}, use the ``serverSelectionTimeoutMS`` option instead. + + To modify the allowed time for `MongoClient.connect <{+api+}/classes/MongoClient.html#connect>`__ to establish a + connection to a {+mdb-server+}, use the ``serverSelectionTimeoutMS`` option instead. **Default:** 30000 * - **socketTimeoutMS** diff --git a/source/fundamentals/run-command.txt b/source/fundamentals/run-command.txt index c5609adb1..b8b80f4bf 100644 --- a/source/fundamentals/run-command.txt +++ b/source/fundamentals/run-command.txt @@ -143,10 +143,8 @@ with the following fields: - Indicates the logical time of the operation. MongoDB uses the logical time to order operations. - .. seealso:: - - To learn more about logical time, see our :website:`blog post about - the Global Logical Clock `. + To learn more about logical time, see our :website:`blog post about + the Global Logical Clock `. * - ``$clusterTime`` - Provides a document that returns the signed cluster time. Cluster time is a