@@ -13,22 +13,24 @@ the MongoDB system.
13
13
Limits
14
14
------
15
15
16
+ BSON Documents
17
+ ~~~~~~~~~~~~~~
18
+
16
19
.. _limit-bson-document-size:
17
- .. limit:: BSON Object Size
20
+ .. limit:: BSON Document Size
18
21
19
- The maximum BSON object size is 16 megabytes.
22
+ The maximum BSON document size is 16 megabytes.
20
23
21
- .. _limit-index-size :
22
- .. limit:: Index Size
24
+ .. _limit-nested-depth :
25
+ .. limit:: Nested Depth for BSON Documents
23
26
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
27
28
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>`.
30
31
31
- A single collection can have *no more* than 64 indexes.
32
+ Namespaces
33
+ ~~~~~~~~~~
32
34
33
35
.. _limit-namespace-length:
34
36
.. limit:: Namespace Length
@@ -38,17 +40,6 @@ Limits
38
40
39
41
.. fix when we know what the actual limit is.
40
42
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
-
52
43
.. _limit-number-of-namespaces:
53
44
.. limit:: Number of Namespaces
54
45
@@ -66,28 +57,72 @@ Limits
66
57
A 16 megabyte namespace file can support 24,000 namespaces.
67
58
68
59
.. _limit-size-of-namespace-file:
69
-
70
60
.. limit:: Size of Namespace File
71
61
72
62
Namespace files can be no larger than 2 gigabytes.
73
63
74
64
By default namespace files are 16 megabytes. You can configure the
75
65
size using the :setting:`nssize`.
76
66
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
+
77
120
.. _limit-sort:
78
121
.. limit:: Sorted Documents
79
122
80
123
MongoDB will only return sorted results on fields without an index
81
124
*if* the sort operation uses less than 32 megabytes of memory.
82
125
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
-
91
126
.. _limit-sharding-limitations:
92
127
.. limit:: Operations Unavailable in Sharded Environments
93
128
@@ -102,13 +137,49 @@ Limits
102
137
from the :operator:`$where` function. This is uncommon in
103
138
un-sharded collections.
104
139
105
- .. _limit-sharding-unique-indexes:
106
- .. limit:: Unique Indexes in Sharded Collections
140
+ Naming Restrictions
141
+ ~~~~~~~~~~~~~~~~~~~
107
142
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
112
144
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.
0 commit comments