This repository has been archived by the owner on Nov 11, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 190
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Query object is immutable, so this shouldn't make a difference in practice.
This was referenced Aug 14, 2013
This will require changes to ODM, as several of its tests expect this to access only $query['query'] contents.
Note: $pullAll only supports an array of values (no expressions), so it remains as-is.
The recursive merging in addManyToSet() dates back to: doctrine/mongodb-odm@59a2da0. This could be problematic if addManyToSet() was called multiple times with deep array values, as they could be merged together in PHP. The new behavior will just overwrite the existing value in $newObj, like other update operators.
MongoDB 2.4 deprecates the $pushAll operator in favor of $push with $each. Additionally, it adds support for $slice and $sort (only in combination with $each).
If the $each operator does not appear first, the $push argument will be considered a single value to append to the array field.
This changes the public API for in/notIn and removes the array cast in notIn (behavior change); however, the methods are now consistent. Other methods that take a single scalar type can use casting to sanitize their input.
geoNear commands against 2dsphere indexes require the "spherical" option to be true, so we can infer its default based on whether or not the "near" option is GeoJSON (in both Builder and Collection).
This makes map() as functional as mapReduce(), apart from setting the "reduce" option.
👍 |
These are not accessed in Query unless the query type is appropriate, and the initializer methods for those query types already create the expected fields.
Also renamed the option, which is set in the query array.
Builder now initializes a much smaller array, which only contains the default type. The array structure will grow as methods are called. In turn, Query only expects the "type", "query", and possibly "newObj" fields to exist. All others are checked for existence before access. geoNear options were moved into an "options" array, which is now consistent with mapReduce and group. A subtle behavioral change is that defaults for update operations and cursor options will no longer be applied unless explicitly set by the user. This should not be a problem, as the Builder defaults were consistent with those in the driver itself.
Builder::hint() is only useful for setting a cursor hint (not related to ODM's UnitOfWork hints), so there is no reason to track multiple calls and apply them all to the cursor in Query::prepareCursor().
This is consistent with what is already done for geoNear commands.
This can be removed in 2.0. It's currently a bit clumsy as the names for some of these types are arbitrary. It would be preferable to use constants.
Changed to avoid calling execute() and throw BadMethodCallException immediately if the query type is not documented as returning an Iterator. If the query type should return an Iterator, we execute it and then throw UnexpectedValueException if it does not.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.