Skip to content

Commit 35fe18f

Browse files
author
Sam Kleinman
committed
DOCS-91 organization and additional facts
1 parent 20b5c9f commit 35fe18f

File tree

2 files changed

+113
-38
lines changed

2 files changed

+113
-38
lines changed

source/reference/limits.txt

Lines changed: 109 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,24 @@ the MongoDB system.
1313
Limits
1414
------
1515

16+
BSON Documents
17+
~~~~~~~~~~~~~~
18+
1619
.. _limit-bson-document-size:
17-
.. limit:: BSON Object Size
20+
.. limit:: BSON Document Size
1821

19-
The maximum BSON object size is 16 megabytes.
22+
The maximum BSON document size is 16 megabytes.
2023

21-
.. _limit-index-size:
22-
.. limit:: Index Size
24+
.. _limit-nested-depth:
25+
.. limit:: Nested Depth for BSON Documents
2326

24-
Indexed items, including their namespace/database, can be *no
25-
larger* than 1024 bytes. This value is the indexed content
26-
(i.e. the field value.)
27+
.. versionchanged:: 2.2
2728

28-
.. _limit-number-of-indexes-per-collection:
29-
.. limit:: Number of Indexes per Collection
29+
MongoDB supports no more than 100 levels of nesting for :term:`BSON
30+
documents <document>`.
3031

31-
A single collection can have *no more* than 64 indexes.
32+
Namespaces
33+
~~~~~~~~~~
3234

3335
.. _limit-namespace-length:
3436
.. limit:: Namespace Length
@@ -38,17 +40,6 @@ Limits
3840

3941
.. fix when we know what the actual limit is.
4042

41-
.. _limit-index-name-length:
42-
.. limit:: Index Name Length
43-
44-
The names of indexes, including their namespace (i.e database and
45-
collection name) cannot be longer than 128 characters.
46-
47-
.. note: the default name is the concantiation of the fields and
48-
directions.
49-
50-
.. ensureIndex/createIndex: supports giving an explicit name.
51-
5243
.. _limit-number-of-namespaces:
5344
.. limit:: Number of Namespaces
5445

@@ -66,28 +57,72 @@ Limits
6657
A 16 megabyte namespace file can support 24,000 namespaces.
6758

6859
.. _limit-size-of-namespace-file:
69-
7060
.. limit:: Size of Namespace File
7161

7262
Namespace files can be no larger than 2 gigabytes.
7363

7464
By default namespace files are 16 megabytes. You can configure the
7565
size using the :setting:`nssize`.
7666

67+
Indexes
68+
~~~~~~~
69+
70+
.. _limit-index-size:
71+
.. limit:: Index Size
72+
73+
Indexed items, including their namespace/database, can be *no
74+
larger* than 1024 bytes. This value is the indexed content
75+
(i.e. the field value.)
76+
77+
.. _limit-number-of-indexes-per-collection:
78+
.. limit:: Number of Indexes per Collection
79+
80+
A single collection can have *no more* than 64 indexes.
81+
82+
.. _limit-index-name-length:
83+
.. limit:: Index Name Length
84+
85+
The names of indexes, including their namespace (i.e database and
86+
collection name) cannot be longer than 128 characters. The default
87+
index name is the concatenation of the field names and index
88+
directions.
89+
90+
You can explicitly specify an name to :dbcommand:`createIndex` or
91+
the :method:`db.collection.ensureIndex()` helper if the default
92+
index name is too long.
93+
94+
.. _limit-sharding-unique-indexes:
95+
.. limit:: Unique Indexes in Sharded Collections
96+
97+
MongoDB does not support unique indexes across shards, except when
98+
the unique index contains the full shard key as a prefix of the
99+
index. In these situations MongoDB will enforce uniqueness across
100+
the full key, not a single field.
101+
102+
.. see:: :doc:`/tutorial/enforce-unique-keys-for-sharded-collections`
103+
for an alternate approach.
104+
105+
Replica Sets
106+
~~~~~~~~~~~~
107+
108+
.. limit:: Number of Members of a Replica Set
109+
110+
Replica sets can ho more than 12 members.
111+
112+
.. limit:: Number of Voting Members of a Replica Set
113+
114+
Only 7 members of a replica set can have votes at any given
115+
time. See can vote :ref:`replica-set-non-voting-members` for more information
116+
117+
Operations
118+
~~~~~~~~~~
119+
77120
.. _limit-sort:
78121
.. limit:: Sorted Documents
79122

80123
MongoDB will only return sorted results on fields without an index
81124
*if* the sort operation uses less than 32 megabytes of memory.
82125

83-
.. _limit-nested-depth:
84-
.. limit:: Nested Depth for BSON Objects
85-
86-
.. versionchanged:: 2.2
87-
88-
MongoDB only supports 100 levels of nesting for :term:`BSON
89-
documents <document>`.
90-
91126
.. _limit-sharding-limitations:
92127
.. limit:: Operations Unavailable in Sharded Environments
93128

@@ -102,13 +137,49 @@ Limits
102137
from the :operator:`$where` function. This is uncommon in
103138
un-sharded collections.
104139

105-
.. _limit-sharding-unique-indexes:
106-
.. limit:: Unique Indexes in Sharded Collections
140+
Naming Restrictions
141+
~~~~~~~~~~~~~~~~~~~
107142

108-
MongoDB does not support unique indexes across shards, except when
109-
the unique index contains the full shard key as a prefix of the
110-
index. In these situations MongoDB will enforce uniqueness across
111-
the full key, not a single field.
143+
.. limit:: Restrictions on Database Names
112144

113-
.. see:: :doc:`/tutorial/enforce-unique-keys-for-sharded-collections`
114-
for an alternate approach.
145+
The dot (i.e. ``.``) character is not permissible in database
146+
names.
147+
148+
Database names are only case sensitive if the underlying file
149+
system has case sensitive file names.
150+
151+
.. versionchanged:: 2.2
152+
For MongoDB instances running on Windows.
153+
154+
In 2.2 the following characters permissible in database names:
155+
156+
.. code-block:: none
157+
158+
/\. "*<>:|?
159+
160+
See :ref:`rn-2.2-database-name-restriction-windows` for more
161+
information.
162+
163+
.. limit:: Restriction on Collection Names
164+
165+
.. versionadded:: 2.2
166+
167+
Collection names should begin with an underscore or a letter
168+
character, and *cannot*:
169+
170+
- contain the ``$``.
171+
172+
- be an empty string (e.g. ``""``).
173+
174+
- contain the null character.
175+
176+
- begin with the ``system.`` prefix. (Reserved for internal use.)
177+
178+
See :ref:`faq-restrictions-on-collection-names` and
179+
:ref:`rn-2.2-collection-name-restriction` for more information.
180+
181+
.. limit:: Restrictions on Field Names
182+
183+
Field names cannot contain dots (i.e. ``.``) or dollar signs
184+
(i.e. ``$``.) See :ref:`faq-dollar-sign-escaping` for an
185+
alternate approach.

source/release-notes/2.2.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ See: :issue:`SERVER-6961` for more information.
304304
Behavioral Changes
305305
~~~~~~~~~~~~~~~~~~
306306

307+
.. _rn-2.2-collection-name-restriction:
308+
307309
Restrictions on Collection Names
308310
````````````````````````````````
309311

@@ -337,6 +339,8 @@ Collections names may have any other valid UTF-8 string.
337339
See the :issue:`SERVER-4442` and the
338340
:ref:`faq-restrictions-on-collection-names` FAQ item.
339341

342+
.. _rn-2.2-database-name-restriction-windows:
343+
340344
Restrictions on Database Names for Windows
341345
``````````````````````````````````````````
342346

0 commit comments

Comments
 (0)