From e80eb1b4920f5fe9400a6fd4d5a2191b6ce9fb98 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Sun, 9 Mar 2014 20:02:08 -0400 Subject: [PATCH 1/3] Grammar fixes for the Single Field Indexes page. --- source/core/index-single.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/core/index-single.txt b/source/core/index-single.txt index e34632bbc89..77ecc5de6d6 100644 --- a/source/core/index-single.txt +++ b/source/core/index-single.txt @@ -52,7 +52,7 @@ Cases ~~~~~~~~~~~~~~~~~~~ MongoDB creates the ``_id`` index, which is an ascending :ref:`unique -index ` on the ``_id`` field for all collections when +index ` on the ``_id`` field, for all collections when the collection is created. You cannot remove the index on the ``_id`` field. @@ -61,7 +61,7 @@ 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 +An :term:`ObjectId` is a 12-byte unique identifier suitable for use as the value of an ``_id`` field. .. note:: @@ -74,7 +74,7 @@ the value of an ``_id`` field. Before version 2.2, :term:`capped collections ` 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 ` for more information. @@ -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 From 66e2f9d0d898cd54731c94cfa9e6f02d07a5ff55 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Sun, 9 Mar 2014 20:07:53 -0400 Subject: [PATCH 2/3] Standardize 'ObjectId' casing and omissions on the Single Field Indexes page. --- source/core/index-single.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/core/index-single.txt b/source/core/index-single.txt index 77ecc5de6d6..8e96419c2cb 100644 --- a/source/core/index-single.txt +++ b/source/core/index-single.txt @@ -28,7 +28,7 @@ Given the following document in the ``friends`` collection: .. code-block:: javascript - { "_id" : ObjectID(...), + { "_id" : ObjectId(...), "name" : "Alice" "age" : 27 } @@ -60,7 +60,7 @@ 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. +: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. @@ -134,7 +134,7 @@ contain a ``metro`` field, such as: .. code-block:: javascript { - _id: ObjectId("523cba3c73a8049bcdbf6007"), + _id: ObjectId(...), metro: { city: "New York", state: "NY" From 6a90180c9b935b793d7118ff8a73fb53573c7663 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Sun, 9 Mar 2014 20:16:49 -0400 Subject: [PATCH 3/3] Render a zip code as a string on the Single Field Indexes page. In general, zip codes should be stored as strings in MongoDB because numbers with leading zeroes are treated as octal numbers in JavaScript. --- source/core/index-single.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/index-single.txt b/source/core/index-single.txt index 8e96419c2cb..f3b8473444d 100644 --- a/source/core/index-single.txt +++ b/source/core/index-single.txt @@ -103,7 +103,7 @@ the following example document: "name": "John Doe" "address": { "street": "Main" - "zipcode": 53511 + "zipcode": "53511" "state": "WI" } }