-
-
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
Implement support for read preferences and use separate Cursor property for ODM's UoW hints #565
Conversation
Successive calls to MongoCursor::hint() or sort() will overwrite the previous value, so there is no reason to store multiple values in the Doctrine class. ODM does seem to depend on the hints property to track UnitOfWork hints (entirely different than MongoDB index usage hints), but that should be changed upstream.
@jmikola has any progress been made on this in the past three months? We would really appreciate having support for readPreference at the query builder level and may write it ourselves if no progress has been made. Is this still the current state of this story? If so, is there anything we can do to help? |
The checklist above is correct; I haven't made any progress on this, but the next step is adding support to doctrine/mongodb before upgrading ODM to work with 1.1.x. |
@jmikola any updates on progress for this issue? Thanks! |
Read preference support in doctrine/mongodb is in progress here: doctrine/mongodb#143 |
This depends on doctrine/mongodb#105 being merged into a stable 1.1.x release of doctrine/mongodb.
Handle ArrayIterator results for commands, fix geospatial tests, and use array argument for notIn() method.
Updated the constructor signatures for Cursor, Builder, and Query classes. See: doctrine/mongodb@39a2b7c#diff-10 ODM's LoggableCursor class only served to log sort() calls with unprepared field names. The wrapped LoggableCursor already logs its own sort() call (with prepared field names). See: doctrine/mongodb@39a2b7c
EagerCursor::next() will now return nothing, which conforms to the Iterator interface.
Set the cursor hint after calling the base method (likewise for the slaveOkay() method)
Create UoW hints property, and use that to store refresh, slaveOkay, and read preference hints. Replace cursor-wrapping in Query::execute() with logic in prepareCursor().
The previous assertions were too fragile, as they would fail if another hint was present in the array. Changed the assertions to only consider the slaveOkay hint.
This method complements the refresh() and slaveOkay() methods.
Implement support for read preferencesUse separate Cursor property for ODM's UoW hints
This PR will require: