Skip to content

DOCSP-15698 identify and correct codeblock indentation #5248

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

Merged
merged 1 commit into from
Apr 21, 2021
Merged
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
6 changes: 3 additions & 3 deletions source/core/index-sparse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The collection has a sparse index on the field ``score``:

.. code-block:: javascript

db.scores.createIndex( { score: 1 } , { sparse: true } )
db.scores.createIndex( { score: 1 } , { sparse: true } )

Then, the following query on the ``scores`` collection uses the sparse
index to return the documents that have the ``score`` field less than
Expand Down Expand Up @@ -160,7 +160,7 @@ The collection has a sparse index on the field ``score``:

.. code-block:: javascript

db.scores.createIndex( { score: 1 } , { sparse: true } )
db.scores.createIndex( { score: 1 } , { sparse: true } )

Because the document for the userid ``"newbie"`` does not contain the
``score`` field, the sparse index does not contain an entry for that
Expand Down Expand Up @@ -217,7 +217,7 @@ the following operation:

.. code-block:: javascript

db.scores.createIndex( { score: 1 } , { sparse: true, unique: true } )
db.scores.createIndex( { score: 1 } , { sparse: true, unique: true } )

This index *would permit* the insertion of documents that had unique
values for the ``score`` field *or* did not include a ``score`` field.
Expand Down
2 changes: 1 addition & 1 deletion source/core/query-optimization.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ For example, a collection ``inventory`` has the following index on the

.. code-block:: javascript

db.inventory.createIndex( { type: 1, item: 1 } )
db.inventory.createIndex( { type: 1, item: 1 } )

This index will cover the following operation which queries on the
``type`` and ``item`` fields and returns only the ``item`` field:
Expand Down
8 changes: 4 additions & 4 deletions source/includes/example-push-each.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ equals ``joe``:

.. code-block:: javascript

db.students.update(
{ name: "joe" },
{ $push: { scores: { $each: [ 90, 92, 85 ] } } }
)
db.students.update(
{ name: "joe" },
{ $push: { scores: { $each: [ 90, 92, 85 ] } } }
)
2 changes: 1 addition & 1 deletion source/includes/output-upgrade-check.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Warning Output

.. code-block:: none

Warning: upgradeCheck only supports V1 indexes. Skipping index: <indexSpec>
Warning: upgradeCheck only supports V1 indexes. Skipping index: <indexSpec>

To resolve, remove the invalid index and recreate the index omitting
the version specification, or reindex the collection. Reindex operation
Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/collStats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The following operation runs the :dbcommand:`collStats` command on the

.. code-block:: javascript

db.runCommand( { collStats : "restaurants", scale: 1024 } )
db.runCommand( { collStats : "restaurants", scale: 1024 } )

The following document provides a representation of the
:dbcommand:`collStats` output. Depending on the configuration of your
Expand Down
16 changes: 8 additions & 8 deletions source/reference/command/currentOp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ database ``db1`` that have been running longer than 3 seconds:

.. code-block:: javascript

db.adminCommand(
{
currentOp: true,
"active" : true,
"secs_running" : { "$gt" : 3 },
"ns" : /^db1\./
}
)
db.adminCommand(
{
currentOp: true,
"active" : true,
"secs_running" : { "$gt" : 3 },
"ns" : /^db1\./
}
)

.. _currentOp-cmd-index-creation:

Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/dataSize.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ and the upper bound of the key to be examined being ``{field: 100}``.

.. code-block:: javascript

db.runCommand({ dataSize: "database.collection", keyPattern: { field: 1 }, min: { field: 10 }, max: { field: 100 } })
db.runCommand({ dataSize: "database.collection", keyPattern: { field: 1 }, min: { field: 10 }, max: { field: 100 } })

This will return a document that contains the size of all matching
documents. Replace ``database.collection`` value with database
Expand Down
28 changes: 14 additions & 14 deletions source/reference/command/findAndModify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,11 @@ following form:

.. code-block:: javascript

db.people.findAndModify( {
query: { name: "Tom", state: "active", rating: { $gt: 10 } },
sort: { rating: 1 },
update: { $inc: { score: 1 } }
} );
db.people.findAndModify( {
query: { name: "Tom", state: "active", rating: { $gt: 10 } },
sort: { rating: 1 },
update: { $inc: { score: 1 } }
} );

However, the :method:`~db.collection.findAndModify()` shell helper
method returns only the unmodified document, or if ``new`` is
Expand All @@ -489,15 +489,15 @@ document or, if no matching document exists, create a new document:

.. code-block:: javascript

db.runCommand(
{
findAndModify: "people",
query: { name: "Gus", state: "active", rating: 100 },
sort: { rating: 1 },
update: { $inc: { score: 1 } },
upsert: true
}
)
db.runCommand(
{
findAndModify: "people",
query: { name: "Gus", state: "active", rating: 100 },
sort: { rating: 1 },
update: { $inc: { score: 1 } },
upsert: true
}
)

If the command finds a matching document, the command performs an update.

Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/removeShard.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ against the ``admin`` database:

.. code-block:: javascript

db.adminCommand( { removeShard : <shardToRemove> } )
db.adminCommand( { removeShard : <shardToRemove> } )

Behavior
--------
Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/usersInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ that resembles the following:

.. code-block:: javascript

db.runCommand( { usersInfo: 1 } )
db.runCommand( { usersInfo: 1 } )

When viewing all users, you can specify the ``showCredentials`` option
but not the ``showPrivileges`` or the
Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/validate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Examples

.. code-block:: javascript

db.runCommand( { validate: "myCollection", full: true } )
db.runCommand( { validate: "myCollection", full: true } )

.. _validate-output:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ by running the following command in the terminal:

.. code-block:: text

sudo apt-key list
sudo apt-key list

The output should include an entry that resembles the following:

Expand Down
42 changes: 21 additions & 21 deletions source/reference/method/db.collection.bulkWrite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,16 @@ five operations.

.. code-block:: javascript

db.collection.bulkWrite(
[
{ insertOne : <document> },
{ updateOne : <document> },
{ updateMany : <document> },
{ replaceOne : <document> },
{ deleteOne : <document> },
{ deleteMany : <document> }
]
)
db.collection.bulkWrite(
[
{ insertOne : <document> },
{ updateOne : <document> },
{ updateMany : <document> },
{ replaceOne : <document> },
{ deleteOne : <document> },
{ deleteMany : <document> }
]
)

In the default ``ordered : true`` state, each operation will
be executed in order, from the first operation ``insertOne``
Expand All @@ -424,17 +424,17 @@ The following code represents an unordered

.. code-block:: javascript

db.collection.bulkWrite(
[
{ insertOne : <document> },
{ updateOne : <document> },
{ updateMany : <document> },
{ replaceOne : <document> },
{ deleteOne : <document> },
{ deleteMany : <document> }
],
{ ordered : false }
)
db.collection.bulkWrite(
[
{ insertOne : <document> },
{ updateOne : <document> },
{ updateMany : <document> },
{ replaceOne : <document> },
{ deleteOne : <document> },
{ deleteMany : <document> }
],
{ ordered : false }
)

With ``ordered : false``, the results of the operation may vary. For example,
the ``deleteOne`` or ``deleteMany`` may remove more or fewer documents
Expand Down
14 changes: 7 additions & 7 deletions source/reference/method/db.currentOp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ database ``db1`` that have been running longer than 3 seconds:

.. code-block:: javascript

db.currentOp(
{
"active" : true,
"secs_running" : { "$gt" : 3 },
"ns" : /^db1\./
}
)
db.currentOp(
{
"active" : true,
"secs_running" : { "$gt" : 3 },
"ns" : /^db1\./
}
)

.. _currentOp-index-creation:

Expand Down
2 changes: 1 addition & 1 deletion source/reference/method/isInteractive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Running a Javascript File inside the ``mongo`` Shell

.. code-block:: javascript

let loadStatus = load("testExample.js"); //You may need to specify the path to the file
let loadStatus = load("testExample.js"); //You may need to specify the path to the file

The method returns in the :binary:`~bin.mongo` shell:

Expand Down
40 changes: 20 additions & 20 deletions source/reference/operator/aggregation/dateFromString.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,16 @@ to a date object:

.. code-block:: javascript

db.logmessages.aggregate( [ {
$project: {
date: {
$dateFromString: {
dateString: '$date',
timezone: 'America/New_York'
}
}
}
} ] )
db.logmessages.aggregate( [ {
$project: {
date: {
$dateFromString: {
dateString: '$date',
timezone: 'America/New_York'
}
}
}
} ] )

The above aggregation returns the following documents and converts each ``date`` field
to the Eastern Time Zone:
Expand All @@ -234,16 +234,16 @@ hard coded argument. For example:

.. code-block:: javascript

db.logmessages.aggregate( [ {
$project: {
date: {
$dateFromString: {
dateString: '$date',
timezone: '$timezone'
}
}
}
} ] )
db.logmessages.aggregate( [ {
$project: {
date: {
$dateFromString: {
dateString: '$date',
timezone: '$timezone'
}
}
}
} ] )

The above aggregation returns the following documents and converts each ``date`` field
to their respective UTC representations.
Expand Down
8 changes: 4 additions & 4 deletions source/reference/operator/aggregation/match.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ the documents:

.. code-block:: javascript

db.articles.aggregate( [
{ $match: { $or: [ { score: { $gt: 70, $lt: 90 } }, { views: { $gte: 1000 } } ] } },
{ $group: { _id: null, count: { $sum: 1 } } }
] );
db.articles.aggregate( [
{ $match: { $or: [ { score: { $gt: 70, $lt: 90 } }, { views: { $gte: 1000 } } ] } },
{ $group: { _id: null, count: { $sum: 1 } } }
] );

In the aggregation pipeline, :pipeline:`$match` selects the documents
where either the ``score`` is greater than ``70`` and less than ``90``
Expand Down
14 changes: 7 additions & 7 deletions source/reference/operator/aggregation/range.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ the stopping points for each trip.

.. code-block:: javascript

db.distances.aggregate([{
$project: {
_id: 0,
city: 1,
"Rest stops": { $range: [ 0, "$distance", 25 ] }
}
}])
db.distances.aggregate([{
$project: {
_id: 0,
city: 1,
"Rest stops": { $range: [ 0, "$distance", 25 ] }
}
}])

The operation returns the following:

Expand Down
28 changes: 14 additions & 14 deletions source/reference/operator/aggregation/redact.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,20 @@ fields contained in a document/embedded document at level ``5``, include a

.. code-block:: javascript

db.accounts.aggregate(
[
{ $match: { status: "A" } },
{
$redact: {
$cond: {
if: { $eq: [ "$level", 5 ] },
then: "$$PRUNE",
else: "$$DESCEND"
}
}
}
]
);
db.accounts.aggregate(
[
{ $match: { status: "A" } },
{
$redact: {
$cond: {
if: { $eq: [ "$level", 5 ] },
then: "$$PRUNE",
else: "$$DESCEND"
}
}
}
]
);

The :pipeline:`$redact` stage evaluates the ``level`` field to
determine access. If the ``level`` field equals ``5``, then exclude all
Expand Down
Loading