Skip to content

DOCS-64 minor changes to note #301

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
Oct 11, 2012
Merged
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
23 changes: 14 additions & 9 deletions source/reference/operator/rename.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,22 @@ $rename
Before version 2.2, when renaming multiple fields and only some (but
not all) old field names refer to non-existing fields:

- **if** no field exists with the new field name, the
:operator:`$rename` operator does nothing.
- For the fields with the old names that do exist, the
:operator:`$rename` operator renames these fields to the
specified new field names.

- For the fields with the old names that do **not** exist:

- **if** no field exists with the new field name, the
:operator:`$rename` operator does nothing.

- **if** fields already exist with the new field names, the
:operator:`$rename` operator drops these fields.
- **if** fields already exist with the new field names, the
:operator:`$rename` operator drops these fields.

Consider the following operation that renames both the
field ``mobile``, which exists, the field ``wife``, which
does not exist. The operation will set the
field named ``wife`` ``alias``, which is the name of an
existing field:
Consider the following operation that renames both the field
``mobile``, which exists, and the field ``wife``, which does
not exist. The operation tries to set the field named ``wife``
to ``alias``, which is the name of an existing field:

.. code-block:: javascript

Expand Down