Skip to content
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
15 changes: 15 additions & 0 deletions docs/reference/sharding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ configured in the association as the field name:
index country: 1
end

The shard key may also reference a field in an embedded document, by using
the "." character to delimit the field names:

.. code-block:: ruby

shard_key "location.x" => 1, "location.y" => 1

shard_key "location.x", "location.y"

.. note::

Because the "." character is used to delimit fields in embedded documents,
Mongoid does not currently support shard key fields that themselves
literally contain the "." character.

.. note::

If a model declares a shard key, Mongoid expects the respective collection
Expand Down