@@ -117,7 +117,67 @@ Which operations lock the database?
117
117
The following table lists common database operations and the types of
118
118
locks they use:
119
119
120
- .. include:: /includes/table/lock-behavior-per-operation.rst
120
+ .. list-table::
121
+ :header-rows: 1
122
+
123
+ * - Operation
124
+
125
+ - Lock Type
126
+
127
+ * - Issue a query
128
+
129
+ - Read lock
130
+
131
+ * - Get more data from a :term:`cursor`
132
+
133
+ - Read lock
134
+
135
+ * - Insert data
136
+
137
+ - Write lock
138
+
139
+ * - Remove data
140
+
141
+ - Write lock
142
+
143
+ * - Update data
144
+
145
+ - Write lock
146
+
147
+ * - :term:`Map-reduce <map-reduce>`
148
+
149
+ - Read lock and write lock, unless operations are specified as
150
+ non-atomic. Portions of map-reduce jobs can run concurrently.
151
+
152
+
153
+ * - Create an index
154
+
155
+ - Building an index in the foreground, which is the default, locks
156
+ the database for extended periods of time.
157
+
158
+
159
+ * - :method:`db.eval()`
160
+
161
+ - Write lock. The :method:`db.eval()` method takes a global write
162
+ lock while evaluating the JavaScript function.
163
+ To avoid taking this global write lock, you can
164
+ use the :dbcommand:`eval` command with ``nolock: true``.
165
+
166
+
167
+ * - :dbcommand:`eval`
168
+
169
+ - Write lock. By default, :dbcommand:`eval` command takes a global
170
+ write lock while evaluating the JavaScript function. If used
171
+ with ``nolock: true``, the :dbcommand:`eval`
172
+ command does *not* take a global write lock while evaluating
173
+ the JavaScript function. However, the logic within the
174
+ JavaScript function may take write locks for write operations.
175
+
176
+
177
+ * - :method:`~db.collection.aggregate()`
178
+
179
+ - Read lock
180
+
121
181
122
182
Which administrative commands lock the database?
123
183
------------------------------------------------
0 commit comments