-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Audit feedback #2074
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
Audit feedback #2074
Changes from 5 commits
cd6d833
fc010f4
4ea9ebd
eac3b12
16b9b5f
e8b75d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,6 +190,17 @@ You can combine the sparse index option with the unique index option | |
| to reject documents that have duplicate values for a field but ignore | ||
| documents that do not have the indexed key. | ||
|
|
||
| TTL Indexes | ||
| ~~~~~~~~~~~ | ||
|
|
||
| :doc:`TTL indexes </core/index-ttl>` are special indexes that MongoDB | ||
| can use to automatically remove documents from a collection after a | ||
| certain amount of time. This is ideal for some types of information | ||
| like machine generated event data, logs, and session information that | ||
| only need to persist in a database for a limited amount of time. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: s/limited/finite/ |
||
|
|
||
| See: :doc:`/tutorial/expire-data` for implementation instructions. | ||
|
|
||
| Index Intersection | ||
| ------------------ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,14 @@ The :ref:`_id index <index-type-id>` is a unique index. In some | |
| situations you may consider using the ``_id`` field itself for this kind | ||
| of data rather than using a unique index on another field. | ||
|
|
||
| In many situations you will want to combine the ``unique`` constraint | ||
| with the ``sparse`` option. When MongoDB indexes a field, if a | ||
| document does not have a value for a field, the index entry for that | ||
| item will be ``null``. Since unique indexes cannot have duplicate | ||
| When MongoDB indexes a field, if a | ||
| document does not have a value for that field, the index entry for that | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would omit the 2nd comma or reverse the ordering to make a clearer conditional: 'If a document does not have a value for a field, the entry for that item will be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh thank goodness. I tried to rephrase that like, six times, and failed. |
||
| item will be ``null``. | ||
| Thus, in many situations you will want to combine the ``unique`` constraint | ||
| with the ``sparse`` option. ``Sparse`` indexes skip over any | ||
| document that is missing the indexed field, rather than storing | ||
| ``null`` for the index entry. Since unique indexes | ||
| cannot have duplicate | ||
| values for a field, without the ``sparse`` option, MongoDB will reject | ||
| the second document and all subsequent documents without the indexed | ||
| field. Consider the following prototype. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/some/certain/