|
54 | 54 | An array of corresponding arguments to the ``function``. Omit
|
55 | 55 | ``args`` if the ``function`` does not take arguments.
|
56 | 56 |
|
57 |
| - :field boolean nolock: |
| 57 | + :field boolean nolock: Optional. |
58 | 58 |
|
59 |
| - Optional. By default, :dbcommand:`eval` takes a global write lock |
60 |
| - before evaluating the JavaScript function. If ``nolock`` is |
61 |
| - ``true``, the :dbcommand:`eval` does not take this global write |
62 |
| - lock before evaluating the function. The flag does not impact |
63 |
| - whether the JavaScript code itself takes a write lock. |
| 59 | + .. include:: /includes/fact-eval-lock.rst |
| 60 | + :end-before: eval-method-lock |
64 | 61 |
|
65 | 62 | Consider the following example which uses :dbcommand:`eval` to
|
66 | 63 | perform an increment and calculate the average on the server:
|
@@ -138,15 +135,8 @@ eval
|
138 | 135 |
|
139 | 136 | .. warning::
|
140 | 137 |
|
141 |
| - - The :dbcommand:`eval` command takes a global write lock by |
142 |
| - default before executing the JavaScript function. This means |
143 |
| - that :dbcommand:`eval` blocks all other read and write |
144 |
| - operations to the database while the :dbcommand:`eval` |
145 |
| - operation runs. You can, however, set the ``nolock`` flag to |
146 |
| - ``true`` to prevent the :dbcommand:`eval` command from taking a |
147 |
| - global write lock before executing the JavaScript function. The |
148 |
| - flag does not impact whether the JavaScript code itself takes |
149 |
| - a write lock. |
| 138 | + - .. include:: /includes/fact-eval-lock.rst |
| 139 | + :end-before: eval-method-lock |
150 | 140 |
|
151 | 141 | - :dbcommand:`eval` also takes a JavaScript lock.
|
152 | 142 |
|
|
0 commit comments