Skip to content

Conversation

knpwrs
Copy link

@knpwrs knpwrs commented Aug 20, 2014

This is a pull request to fix NODE-246.

scope.js had its own Cursor constructor which was used instead of the exposed require('mongo').Cursor example. This caused problems with people who wanted to promisify their cursors.

This pull request removes the duplicate constructor and adds a cloneWithOptions static method to the remaining Cursor constructor. This also improves efficiency (the duplicate constructor set properties on itself on every construction instead of utilizing the prototype chain) and removes a global leak which was present in the duplicate constructor.

There is also a new test to verify that the cursors returned are instances of the exposed Cursor constructor.

@christkv christkv merged commit 11584c9 into mongodb:master Aug 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants