Skip to content

Fixes for the 'Single Field Indexes' page #1644

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

Closed
wants to merge 3 commits into from
Closed
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
16 changes: 8 additions & 8 deletions source/core/index-single.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Given the following document in the ``friends`` collection:

.. code-block:: javascript

{ "_id" : ObjectID(...),
{ "_id" : ObjectId(...),
"name" : "Alice"
"age" : 27
}
Expand All @@ -52,16 +52,16 @@ Cases
~~~~~~~~~~~~~~~~~~~

MongoDB creates the ``_id`` index, which is an ascending :ref:`unique
index <index-type-unique>` on the ``_id`` field for all collections when
index <index-type-unique>` on the ``_id`` field, for all collections when
the collection is created. You cannot remove the index on the ``_id``
field.

Think
of the ``_id`` field as the :term:`primary key` for a collection.
Every document *must* have a unique ``_id`` field. You may store any
unique value in the ``_id`` field. The default value of ``_id`` is an
:term:`ObjectID` on every :method:`~db.collection.insert()` operation.
An :term:`ObjectId` is a 12-byte unique identifiers suitable for use as
:term:`ObjectId` on every :method:`~db.collection.insert()` operation.
An :term:`ObjectId` is a 12-byte unique identifier suitable for use as
the value of an ``_id`` field.

.. note::
Expand All @@ -74,7 +74,7 @@ the value of an ``_id`` field.

Before version 2.2, :term:`capped collections <capped collection>`
did not have an ``_id`` field. In version 2.2 and newer, capped
collection do have an ``_id`` field, except those in the ``local``
collections do have an ``_id`` field, except those in the ``local``
:term:`database`. See :ref:`Capped Collections Recommendations
and Restrictions <capped-collections-recommendations-and-restrictions>`
for more information.
Expand Down Expand Up @@ -103,7 +103,7 @@ the following example document:
"name": "John Doe"
"address": {
"street": "Main"
"zipcode": 53511
"zipcode": "53511"
"state": "WI"
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ contain a ``metro`` field, such as:
.. code-block:: javascript

{
_id: ObjectId("523cba3c73a8049bcdbf6007"),
_id: ObjectId(...),
metro: {
city: "New York",
state: "NY"
Expand All @@ -143,7 +143,7 @@ contain a ``metro`` field, such as:
}

The ``metro`` field is a subdocument, containing the embedded fields
``city`` and ``state``. The following creates an index on the ``metro``
``city`` and ``state``. The following command creates an index on the ``metro``
field as a whole:

.. code-block:: javascript
Expand Down