Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Internal cursor improvements for hint, sort, RP and recreation #105

Merged
merged 4 commits into from
Apr 23, 2013

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Apr 22, 2013

A few changes here:

  • Avoid accumulating arguments for multiple calls to hint() and sort(). ODM does seem to use $hints to store it's own refresh/slaveOkay hints, but that should be changed upstream. ODM currently requires doctrine/mongodb 1.0.*, and this would be merged to 1.1.x, so I don't see a problem.
  • Added unit tests for recreate(), which should help with Paginator adapter ignore sorting DoctrineMongoODMModule#70.
  • Improve setReadPreference() by making it chainable, able to throw an exception if the driver method fails, and integrating it with recreate().

jmikola added a commit to doctrine/mongodb-odm that referenced this pull request Apr 22, 2013
This depends on doctrine/mongodb#105 being merged into a stable 1.1.x release of doctrine/mongodb.
@jmikola
Copy link
Member Author

jmikola commented Apr 22, 2013

@jwage: This is based on what we discussed in IRC last week. Please give it a once-over when you get a chance. I'd like to move onto supporting read preferences in the query builder after this, and then resolve the referenced ODM PR.

jmikola added 4 commits April 23, 2013 11:16
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.
Change the return value for setReadPreference() so it can be chained with other methods. The boolean return code from the MongoCursor method will be checked and used to throw an exception if necessary.

Save the current read preference and tags on Cursor, so it can be recreated (as is done for slaveOkay).
@jwage
Copy link
Member

jwage commented Apr 23, 2013

👍

jmikola added a commit that referenced this pull request Apr 23, 2013
Internal cursor improvements for hint, sort, RP and recreation
@jmikola jmikola merged commit 68a820f into master Apr 23, 2013
@jmikola jmikola deleted the cursor-recreate branch April 23, 2013 15:51
jmikola added a commit to doctrine/mongodb-odm that referenced this pull request Jun 4, 2013
This depends on doctrine/mongodb#105 being merged into a stable 1.1.x release of doctrine/mongodb.
jmikola added a commit to doctrine/mongodb-odm that referenced this pull request Nov 1, 2013
This depends on doctrine/mongodb#105 being merged into a stable 1.1.x release of doctrine/mongodb.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants