Skip to content

DOCS-14827: $merge and partial indexes #5970

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 12, 2021
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
7 changes: 5 additions & 2 deletions source/reference/operator/aggregation/merge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ The :pipeline:`$merge` takes a document with the following fields:
- The unique index can be a :ref:`sparse <index-type-sparse>`
index.

- The unique index cannot be a :ref:`partial <index-type-partial>`
index.

- For output collections that already exist, the corresponding
index must already exist.

Expand Down Expand Up @@ -517,10 +520,10 @@ The ``newrestaurants`` collection will contain documents with
information on new restaurant openings by month (``date`` field) and
postcode (shard key); specifically, the :ref:`on <merge-on>`
identifier is ``["date", "postcode"]`` (the ordering of the fields
does not matter). Because :pipeline:`$merge` requires a unique,
does not matter). Because :pipeline:`$merge` requires a unique
index with keys that correspond to the :ref:`on
<merge-on>` identifier fields, create the unique index
(the ordering of the fields do not matter): [#uniqueoption]_
(the ordering of the fields do not matter): [#uniqueoption]_

.. code-block:: javascript

Expand Down