-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Add support for partial indexes #1303
Conversation
Long time no see, I've updated the XML mapping. The example in the comment above outlines the straight-forward mapping. For more complicated mappings, there are additional possiblilities. You can either check properties of embedded documents (checking only those properties mentioned):
Or check a document for equality (ensuring that a document looks exactly like what's provided):
With this it's also possible to use the
When using |
@@ -237,6 +237,9 @@ private function addIndex(ClassMetadataInfo $class, $index, array $keys = array( | |||
$options[$name] = $index->$name; | |||
} | |||
} | |||
if (! empty($index->partialFilterExpression)) { |
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.
Missing space before !
;)
I think we should have tests for expression with |
@malarzm Good idea, I'll add a few extra documents to be safe. |
In this case, we treat an empty filter expression like a missing one to avoid recreating indexes because of differences in what's defined as "empty".
@malarzm Added tests for various filter expressions being loaded via XML and YAML to ensure they are the same. Invalid filter expressions will only be fixed by the XML driver as YAML and annotations are schemaless and will just let the database throw a fit if the expression is invalid. |
👍 |
Add support for partial indexes
MongoDB 3.2 adds support for partial indexes. This PR adds support for adding partialIndexExpression options to the index specification.
Examples:
List of TODOs: