Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docsp 42965 nesting #924

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions source/code-snippets/usage-examples/bulkWrite.js
Original file line number Diff line number Diff line change
@@ -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 = "<connection string uri>";

const client = new MongoClient(uri);
Expand All @@ -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: {
Expand Down Expand Up @@ -44,22 +46,19 @@ async function run() {
},
},
{
// Update documents that match the specified filter
updateMany: {
filter: { "location.address.zipcode": "44011" },
update: { $set: { is_in_ohio: true } },
upsert: true,
},
},
{
// 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();
}
}
Expand Down
8 changes: 3 additions & 5 deletions source/faq.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
6 changes: 2 additions & 4 deletions source/fundamentals/run-command.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 </blog/post/transactions-background-part-4-the-global-logical-clock>`.
To learn more about logical time, see our :website:`blog post about
the Global Logical Clock </blog/post/transactions-background-part-4-the-global-logical-clock>`.

* - ``$clusterTime``
- Provides a document that returns the signed cluster time. Cluster time is a
Expand Down
Loading