Skip to content

Commit a337121

Browse files
author
Sam Kleinman
committed
DOCS-653: edits in response to reviews from kevin m.
1 parent 4efa57b commit a337121

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

source/core/capped-collections.txt

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ by overwriting the oldest documents in the collection.
1414
Capped collections have the following behaviors:
1515

1616
- Capped collections guarantee preservation of the insertion order. As
17-
a result, queries do not need an index to return documents ordered
18-
by the insertion order. Without this indexing overhead, they can
17+
a result, queries do not need an index to return documents in
18+
insertion order. Without this indexing overhead, they can
1919
support higher insertion throughput.
2020

2121
- Capped collections guarantee that insertion order is identical to the
@@ -33,7 +33,7 @@ collection. Consider the following potential uses cases for capped
3333
collections:
3434

3535
- Store log information generated by high-volume systems. Inserting
36-
documents in an capped collection without an index is close to the
36+
documents in a capped collection without an index is close to the
3737
speed of writing log information directly to a file
3838
system. Furthermore, the built-in *first-in-first-out* property
3939
maintains the order of events, while managing storage use.
@@ -49,33 +49,36 @@ Recommendations and Restrictions
4949

5050
- You cannot shard a capped collection.
5151

52-
- Only capped collections created after 2.2 have an ``_id`` field and
53-
indexes on the ``_id`` field. Capped collections created before 2.2
54-
do indexes on the ``_id`` by default.
52+
- Capped collections created after 2.2 have an ``_id`` field and an
53+
index on the ``_id`` field by default. Capped collections created
54+
before 2.2 do not have an index on the ``_id`` field by default. If
55+
you are using capped collections with replication prior to 2.2, you
56+
should explicitly create an index on the ``_id`` field.
5557

5658
- You *can* update documents in a collection after inserting them;
5759
*however*, these updates *cannot* cause the documents to grow. If the
58-
update operation causes the document to grow, the update operation
59-
will fail.
60+
update operation causes the document to grow beyond their original
61+
size, the update operation will fail.
6062

6163
If you plan to update documents in a capped
6264
collection, remember to create an index to prevent update
6365
operations that require a table scan.
6466

6567
- You cannot delete documents from a capped collection. To remove all
66-
records from the collection, use the :dbcommand:`emptycapped`
67-
command.
68+
records from a capped collection, use the 'emptycapped' command. To
69+
remove the collection entirely, use the :method:`drop()
70+
<db.collection.drop()>` method.
6871

6972
.. warning::
7073

7174
If you have a capped collection in a :term:`replica set` outside of
7275
the ``local`` database, before 2.2, you should create a unique
7376
index on ``_id``. Ensure uniqueness using the ``unique: true``
7477
option to the :method:`ensureIndex() <db.collection.ensureIndex()>`
75-
by using an :term:`ObjectId` for the ``_id`` field use the
76-
``autoIndexId`` option to :dbcommand:`createCollection` when
77-
creating the capped collection, as in the
78-
:ref:`capped-collections-options` procedure.
78+
method or by using an :term:`ObjectId` for the ``_id``
79+
field. Alternately, you can use the ``autoIndexId`` option to
80+
:dbcommand:`createCollection` when creating the capped collection,
81+
as in the :ref:`capped-collections-options` procedure.
7982

8083
- Use natural ordering to retrieve the most recently inserted elements
8184
from the collection efficiently. This is (somewhat) analogous to

0 commit comments

Comments
 (0)