Skip to content
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
4 changes: 2 additions & 2 deletions source/core/index-wildcard.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,15 @@ Consider the following wildcard index on the ``employees`` collection:

.. code-block:: javascript

db.products.createIndex( { "$**" : 1 } )
db.employees.createIndex( { "$**" : 1 } )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix!


The following operation queries for a single field
``lastName`` and projects out all other fields from the
resulting document:

.. code-block:: javascript

db.products.find(
db.employees.find(
{ "lastName" : "Doe" },
{ "_id" : 0, "lastName" : 1 }
)
Expand Down
6 changes: 3 additions & 3 deletions source/core/multikey-index-bounds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ field ``ratings`` to require that the array contains at least one

Taking the predicates separately:

- the bounds for the ``score: { $lte: 5 }`` predicate is ``[ -Infinity, 5
]``;
- the bounds for the ``score: { $lte: 5 }`` predicate are ``[ [ -Infinity, 5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with changing "is" to "are", but what is the motivation for the double square brackets?

Copy link
Contributor Author

@RafaelGreen1 RafaelGreen1 Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears like this in all other places on this page. Search "[ [" to see the other occurrences.
It makes sense to me because bounds are arrays of arrays. For example [ [1,3], [8,10] ]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thank you for clarifying! You're absolutely correct.

] ]``;

- the bounds for the ``by: "anon"`` predicate is ``[ "anon", "anon" ]``.
- the bounds for the ``by: "anon"`` predicate are ``[ [ "anon", "anon" ] ]``.

MongoDB can compound the two bounds to use the combined bounds of:

Expand Down