-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Sharding support implemented #691
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,10 @@ public function loadMetadataForClass($className, ClassMetadata $class) | |
$mapping['alsoLoadFields'] = (array) $annot->value; | ||
} elseif ($annot instanceof ODM\Version) { | ||
$mapping['version'] = true; | ||
} elseif (property_exists($annot, 'options') | ||
&& isset($annot->options['isShardKey']) | ||
&& $annot->options['isShardKey'] == true) { | ||
$class->addShardKey($mapping['fieldName']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the order of calls to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just looked for relevance in shard key order when querying but haven't found anything. LMK if I'm wrong, but AFAIK order of keys is irrelevant. Also, in JS console look at the following scenario:
and the shard key is following:
As I wrote, if I'm wrong LMK and will reconsider, but otherwise don't see a point in it. |
||
} elseif ($annot instanceof ODM\Lock) { | ||
$mapping['lock'] = true; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation for these looks off. Are you using tabs instead of 4 spaces per level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be tabs, will have to check, but that can be easily modified