We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc0cd85 commit 630890aCopy full SHA for 630890a
source/reference/sharding.txt
@@ -83,6 +83,21 @@ configured in the association as the field name:
83
index country: 1
84
end
85
86
+The shard key may also reference a field in an embedded document, by using
87
+the "." character to delimit the field names:
88
+
89
+.. code-block:: ruby
90
91
+ shard_key "location.x" => 1, "location.y" => 1
92
93
+ shard_key "location.x", "location.y"
94
95
+.. note::
96
97
+ Because the "." character is used to delimit fields in embedded documents,
98
+ Mongoid does not currently support shard key fields that themselves
99
+ literally contain the "." character.
100
101
.. note::
102
103
If a model declares a shard key, Mongoid expects the respective collection
0 commit comments