From 40642c2cedd8f37f2cfc26f749b04c8c39d4a9ec Mon Sep 17 00:00:00 2001 From: Chris Cho Date: Wed, 9 Nov 2022 23:57:31 -0500 Subject: [PATCH] Fix code block indentation --- source/fundamentals/collations.txt | 28 ++++++------ source/fundamentals/crud/query-document.txt | 20 ++++----- source/fundamentals/logging.txt | 16 +++---- source/quick-start.txt | 48 ++++++++++----------- 4 files changed, 56 insertions(+), 56 deletions(-) diff --git a/source/fundamentals/collations.txt b/source/fundamentals/collations.txt index 0e8125a8e..d8171a805 100644 --- a/source/fundamentals/collations.txt +++ b/source/fundamentals/collations.txt @@ -193,10 +193,10 @@ following documents: .. code-block:: none - { "_id" : 1, "first_name" : "Hans" } - { "_id" : 2, "first_name" : "Gunter" } - { "_id" : 3, "first_name" : "Günter" } - { "_id" : 4, "first_name" : "Jürgen" } + { "_id" : 1, "first_name" : "Hans" } + { "_id" : 2, "first_name" : "Gunter" } + { "_id" : 3, "first_name" : "Günter" } + { "_id" : 4, "first_name" : "Jürgen" } Consider the following ``findOneAndUpdate()`` operation on this collection which **does not** specify a collation: @@ -229,9 +229,9 @@ the operation returns the following updated document: .. code-block:: none - { lastErrorObject: { updatedExisting: true, n: 1 }, - value: { _id: 3, first_name: 'Günter' }, - ok: 1 } + { lastErrorObject: { updatedExisting: true, n: 1 }, + value: { _id: 3, first_name: 'Günter' }, + ok: 1 } findOneAndDelete() Example `````````````````````````` @@ -242,9 +242,9 @@ documents: .. code-block:: none - { "_id" : 1, "a" : "16" } - { "_id" : 2, "a" : "84" } - { "_id" : 3, "a" : "179" } + { "_id" : 1, "a" : "16" } + { "_id" : 2, "a" : "84" } + { "_id" : 3, "a" : "179" } In this example, we set the ``numericOrdering`` collation parameter to ``true`` to sort numeric strings based on their numerical order instead of their @@ -260,8 +260,8 @@ documents: .. code-block:: none - { "_id" : 1, "a" : "16" } - { "_id" : 2, "a" : "84" } + { "_id" : 1, "a" : "16" } + { "_id" : 2, "a" : "84" } If you perform the same operation without collation on the original collection of three documents, it matches documents based on the lexical value @@ -280,8 +280,8 @@ contains the following documents: .. code-block:: none - { "_id" : 2, "a" : "84" } - { "_id" : 3, "a" : "179" } + { "_id" : 2, "a" : "84" } + { "_id" : 3, "a" : "179" } Aggregation Example ``````````````````` diff --git a/source/fundamentals/crud/query-document.txt b/source/fundamentals/crud/query-document.txt index a2f2c94f7..9694c9c22 100644 --- a/source/fundamentals/crud/query-document.txt +++ b/source/fundamentals/crud/query-document.txt @@ -148,19 +148,19 @@ This code snippet returns the following results: .. code-block:: javascript - collection.find({ - rating: { $eq: 5 }, - qty: { $gt: 4 } - }) + collection.find({ + rating: { $eq: 5 }, + qty: { $gt: 4 } + }) .. code-block:: javascript - collection.find({ - $and: [ - { rating: { $eq: 5 }}, - { qty: { $gt: 4 }} - ] - }) + collection.find({ + $and: [ + { rating: { $eq: 5 }}, + { qty: { $gt: 4 }} + ] + }) For more information on comparison operators, see the reference manual entry for :manual:`Comparison Query Operators `. diff --git a/source/fundamentals/logging.txt b/source/fundamentals/logging.txt index 3cbe2fc13..0a3ebc655 100644 --- a/source/fundamentals/logging.txt +++ b/source/fundamentals/logging.txt @@ -15,10 +15,10 @@ Logging The driver doesn't use the logger in versions 4.0 and later. Attempting to use prior logger settings in this version won't print anything in the log. - + Instead, see our monitoring guides: - - :doc:`Command Monitoring ` + - :doc:`Command Monitoring ` - :doc:`Cluster Monitoring ` Temporary Alternative @@ -29,9 +29,9 @@ meantime, you can output monitor events using the following snippet: .. code-block:: javascript - const uri = "mongodb+srv://:@?writeConcern=majority"; - const client = new MongoClient(uri, { monitorCommands:true }); - - client.on('commandStarted', (event) => console.debug(event)); - client.on('commandSucceeded', (event) => console.debug(event)); - client.on('commandFailed', (event) => console.debug(event)); + const uri = "mongodb+srv://:@?writeConcern=majority"; + const client = new MongoClient(uri, { monitorCommands:true }); + + client.on('commandStarted', (event) => console.debug(event)); + client.on('commandSucceeded', (event) => console.debug(event)); + client.on('commandFailed', (event) => console.debug(event)); diff --git a/source/quick-start.txt b/source/quick-start.txt index 39ca945bb..95bf5887a 100644 --- a/source/quick-start.txt +++ b/source/quick-start.txt @@ -137,30 +137,30 @@ Connect to Your Application .. code-block:: js - const { MongoClient } = require("mongodb"); - - // Replace the uri string with your connection string. - const uri = - "mongodb+srv://:@?retryWrites=true&w=majority"; - - const client = new MongoClient(uri); - - async function run() { - try { - const database = client.db('sample_mflix'); - const movies = database.collection('movies'); - - // Query for a movie that has the title 'Back to the Future' - const query = { title: 'Back to the Future' }; - const movie = await movies.findOne(query); - - console.log(movie); - } finally { - // Ensures that the client will close when you finish/error - await client.close(); - } - } - run().catch(console.dir); + const { MongoClient } = require("mongodb"); + + // Replace the uri string with your connection string. + const uri = + "mongodb+srv://:@?retryWrites=true&w=majority"; + + const client = new MongoClient(uri); + + async function run() { + try { + const database = client.db('sample_mflix'); + const movies = database.collection('movies'); + + // Query for a movie that has the title 'Back to the Future' + const query = { title: 'Back to the Future' }; + const movie = await movies.findOne(query); + + console.log(movie); + } finally { + // Ensures that the client will close when you finish/error + await client.close(); + } + } + run().catch(console.dir); .. tip::