Skip to content

Commit f8665f1

Browse files
author
Bob Grabar
committed
DOCS-664 review edits
1 parent 8107e1d commit f8665f1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

source/faq/developers.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,17 @@ storage efficiently in such situations.
162162

163163
- Use the ``_id`` field explicitly.
164164

165-
MongoDB automatically adds an :term:`ObjectId` to each document and sets it to
165+
MongoDB clients automatically add an :term:`ObjectId` to each document and set it to
166166
a unique value. Additionally this field in indexed. For tiny documents
167-
this takes up significant space. To optimize, use the ``_id``
168-
explicitly. Take a field that is unique for the collection and store
169-
its values in ``_id``. By doing so, you have explicitly provided IDs.
170-
This eliminates the creation of a separate ``_id`` field. If your
171-
previously separate field was indexed, this eliminates an extra index,
172-
too.
167+
this takes up significant space.
168+
169+
To optimize, users can provide a value for the ``_id`` field
170+
explicitly. The goal is to leverage the ``_id`` field to store a value
171+
that would have occupied space in another portion of the document. The
172+
only requirement for the ``_id`` field value is that it must serve as
173+
a primary key for documents in the collection by uniquely identifying
174+
them. If the field's value is not unique, then it cannot serve as a
175+
primary key as there would be collisions in the namespace.
173176

174177
- Use shorter field names. This is recommended only in certain situations.
175178

0 commit comments

Comments
 (0)