File tree Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change
1
+ With :setting: `authentication <auth> ` enabled, |object | will fail
2
+ during the operation if you do not have the permission to perform a
3
+ specified task.
4
+
5
+ .. .. versionchanged:: 2.4 You must have full admin access to run.
Original file line number Diff line number Diff line change 1
1
By default, |object | takes a global write lock before evaluating the
2
2
JavaScript function. As a result, |object | blocks all other read and
3
- write operations to the database while the |object | operation
4
- runs. Set ``nolock `` to ``true `` to prevent | object | from taking the
5
- global write lock before evaluating the JavaScript. `` nolock `` does
6
- not impact whether operations within the JavaScript code itself takes
7
- a write lock.
3
+ write operations to the database while the |object | operation runs. Set
4
+ ``nolock `` to ``true `` on the | nolockobject | to prevent the
5
+ | nolockobject | from taking the global write lock before evaluating the
6
+ JavaScript. `` nolock `` does not impact whether operations within the
7
+ JavaScript code itself takes a write lock.
Original file line number Diff line number Diff line change 57
57
:field boolean nolock: Optional.
58
58
59
59
.. |object| replace:: :dbcommand:`eval`
60
+ .. |nolockobject| replace:: :dbcommand:`eval` command
60
61
.. include:: /includes/fact-eval-lock.rst
61
62
62
63
Consider the following example which uses :dbcommand:`eval` to
@@ -136,12 +137,13 @@ eval
136
137
.. warning::
137
138
138
139
.. \|object| defined above ..
140
+ .. \|nolockobject| defined above ..
139
141
140
142
- .. include:: /includes/fact-eval-lock.rst
141
143
142
- - :dbcommand:`eval` also takes a JavaScript lock.
144
+ - :dbcommand:`eval` also takes a JavaScript lock.
143
145
144
- .. modified in 2.4 version, the JavaScript lock is up to and including version 2.2
146
+ .. modified in 2.4 version, the JavaScript lock is up to and including version 2.2
145
147
146
148
- Do not use :dbcommand:`eval` for long running operations as
147
149
:dbcommand:`eval` blocks all other operations. Consider using
154
156
is possible to use :dbcommand:`eval` with non-sharded
155
157
collections and databases stored in a :term:`sharded cluster`.
156
158
159
+ - .. include:: /includes/fact-eval-authentication.rst
160
+
157
161
.. seealso:: :doc:`/applications/server-side-javascript`
Original file line number Diff line number Diff line change @@ -95,11 +95,13 @@ db.eval()
95
95
96
96
.. |object| replace:: :method:`db.eval()`
97
97
98
+ .. |nolockobject| replace:: :dbcommand:`eval` *command*
99
+
98
100
- .. include:: /includes/fact-eval-lock.rst
99
101
100
102
- :method:`db.eval()` also takes a JavaScript lock.
101
103
102
- .. modified in 2.4 version, the JavaScript lock is up to and including version 2.2
104
+ .. modified in 2.4 version, the JavaScript lock is up to and including version 2.2
103
105
104
106
- Do not use :method:`db.eval()` for long running operations, as
105
107
:method:`db.eval()` blocks all other operations. Consider using
@@ -112,6 +114,8 @@ db.eval()
112
114
it is possible to use :method:`db.eval()` with non-sharded
113
115
collections and databases stored in :term:`sharded cluster`.
114
116
117
+ - .. include:: /includes/fact-eval-authentication.rst
118
+
115
119
.. seealso::
116
120
117
121
:doc:`/applications/server-side-javascript`
You can’t perform that action at this time.
0 commit comments