diff --git a/source/includes/fact-eval-authentication.rst b/source/includes/fact-eval-authentication.rst new file mode 100644 index 00000000000..3d6242e9b74 --- /dev/null +++ b/source/includes/fact-eval-authentication.rst @@ -0,0 +1,5 @@ +With :setting:`authentication ` enabled, |object| will fail +during the operation if you do not have the permission to perform a +specified task. + +.. .. versionchanged:: 2.4 You must have full admin access to run. \ No newline at end of file diff --git a/source/includes/fact-eval-lock.rst b/source/includes/fact-eval-lock.rst index 1b359458202..a7e35e082e3 100644 --- a/source/includes/fact-eval-lock.rst +++ b/source/includes/fact-eval-lock.rst @@ -1,7 +1,7 @@ By default, |object| takes a global write lock before evaluating the JavaScript function. As a result, |object| blocks all other read and -write operations to the database while the |object| operation -runs. Set ``nolock`` to ``true`` to prevent |object| from taking the -global write lock before evaluating the JavaScript. ``nolock`` does -not impact whether operations within the JavaScript code itself takes -a write lock. +write operations to the database while the |object| operation runs. Set +``nolock`` to ``true`` on the |nolockobject| to prevent the +|nolockobject| from taking the global write lock before evaluating the +JavaScript. ``nolock`` does not impact whether operations within the +JavaScript code itself takes a write lock. diff --git a/source/reference/command/eval.txt b/source/reference/command/eval.txt index 242e251dc53..373b35c545e 100644 --- a/source/reference/command/eval.txt +++ b/source/reference/command/eval.txt @@ -57,6 +57,7 @@ eval :field boolean nolock: Optional. .. |object| replace:: :dbcommand:`eval` + .. |nolockobject| replace:: :dbcommand:`eval` command .. include:: /includes/fact-eval-lock.rst Consider the following example which uses :dbcommand:`eval` to @@ -136,12 +137,13 @@ eval .. warning:: .. \|object| defined above .. + .. \|nolockobject| defined above .. - .. include:: /includes/fact-eval-lock.rst - - :dbcommand:`eval` also takes a JavaScript lock. + - :dbcommand:`eval` also takes a JavaScript lock. -.. modified in 2.4 version, the JavaScript lock is up to and including version 2.2 + .. modified in 2.4 version, the JavaScript lock is up to and including version 2.2 - Do not use :dbcommand:`eval` for long running operations as :dbcommand:`eval` blocks all other operations. Consider using @@ -154,4 +156,6 @@ eval is possible to use :dbcommand:`eval` with non-sharded collections and databases stored in a :term:`sharded cluster`. + - .. include:: /includes/fact-eval-authentication.rst + .. seealso:: :doc:`/applications/server-side-javascript` diff --git a/source/reference/method/db.eval.txt b/source/reference/method/db.eval.txt index 029e11784c1..bba662a4702 100644 --- a/source/reference/method/db.eval.txt +++ b/source/reference/method/db.eval.txt @@ -95,11 +95,13 @@ db.eval() .. |object| replace:: :method:`db.eval()` + .. |nolockobject| replace:: :dbcommand:`eval` *command* + - .. include:: /includes/fact-eval-lock.rst - :method:`db.eval()` also takes a JavaScript lock. -.. modified in 2.4 version, the JavaScript lock is up to and including version 2.2 + .. modified in 2.4 version, the JavaScript lock is up to and including version 2.2 - Do not use :method:`db.eval()` for long running operations, as :method:`db.eval()` blocks all other operations. Consider using @@ -112,6 +114,8 @@ db.eval() it is possible to use :method:`db.eval()` with non-sharded collections and databases stored in :term:`sharded cluster`. + - .. include:: /includes/fact-eval-authentication.rst + .. seealso:: :doc:`/applications/server-side-javascript`