@@ -316,7 +316,7 @@ Sparse Index
316
316
~~~~~~~~~~~~
317
317
318
318
Sparse indexes only contain entries for documents that have the
319
- indexed field. By contrast, non-sparse indexes contain all documents
319
+ indexed field. [#null-values-are-indexed-in-sparse-indexes]_ By contrast, non-sparse indexes contain all documents
320
320
in a collection, and store null values for documents that do not
321
321
contain the indexed field. Create a sparse index on the ``xmpp_id``
322
322
field, of the ``members`` collection, using the following operation in
@@ -334,7 +334,7 @@ the :program:`mongo` shell:
334
334
335
335
.. note::
336
336
337
- Sparse indexes in MongoDB are not to be confused with `block-level`_
337
+ Do not confuse sparse indexes in MongoDB with `block-level`_
338
338
indexes in other databases. Think of them as dense indexes with a
339
339
specific filter.
340
340
@@ -345,6 +345,10 @@ the :program:`mongo` shell:
345
345
346
346
.. _`block-level`: http://en.wikipedia.org/wiki/Index_%28database%29#Sparse_index>
347
347
348
+ .. [#null-values-are-indexed-in-sparse-indexes] All documents that
349
+ have the indexed field *are* indexed in a sparse index, even if
350
+ that field stores a null value in some documents.
351
+
348
352
.. _index-creation-operations:
349
353
.. _index-operations:
350
354
@@ -394,7 +398,7 @@ construction:
394
398
395
399
.. versionchanged:: 2.2
396
400
Before 2.2, a single :program:`mongod` instance could only build
397
- one index at a time.
401
+ one index at a time.
398
402
399
403
- The indexing operation runs in the background so that other database
400
404
operations can run while creating the index. However, the
0 commit comments