diff --git a/source/code-snippets/usage-examples/bulkWrite.js b/source/code-snippets/usage-examples/bulkWrite.js index 5fc52d423..9b40e2835 100644 --- a/source/code-snippets/usage-examples/bulkWrite.js +++ b/source/code-snippets/usage-examples/bulkWrite.js @@ -1,9 +1,12 @@ +<<<<<<< HEAD +======= // Bulk write operation // Import MongoClient from the MongoDB node driver package +>>>>>>> 92c7dfa4819a34440a6dc8f8c9c7dca1c6dba71e 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 +16,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 +46,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 +53,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..99a579453 100644 --- a/source/fundamentals/run-command.txt +++ b/source/fundamentals/run-command.txt @@ -141,12 +141,8 @@ with the following fields: * - ``operationTime`` - 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 `. + logical time to order operations. 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