Skip to content

eval authentication and fix lock warning #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/includes/fact-eval-authentication.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
With :setting:`authentication <auth>` 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.
10 changes: 5 additions & 5 deletions source/includes/fact-eval-lock.rst
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 6 additions & 2 deletions source/reference/command/eval.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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`
6 changes: 5 additions & 1 deletion source/reference/method/db.eval.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`