Skip to content

fix(collection): fix error when calling remove with no args - #1657

Merged
daprahamian merged 1 commit into
3.0.0from
NODE-1287
Jan 30, 2018
Merged

fix(collection): fix error when calling remove with no args#1657
daprahamian merged 1 commit into
3.0.0from
NODE-1287

Conversation

@daprahamian

Copy link
Copy Markdown
Contributor

Calling remove with no arguments resulted in an error b/c
of the lack of options.

Fixes NODE-1287

@mbroadst @jlord I'm wondering if we should instead fix this in executeOperation?

Comment thread lib/collection.js
@@ -1236,6 +1236,8 @@ Collection.prototype.remove = function(selector, options, callback) {
options.ignoreUndefined = this.s.options.ignoreUndefined;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we actually need a whole:

if (typeof options === 'function') (callback = options), (options = {});
options = options || {};

// Add ignoreUndefined....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to include that

Calling remove with no arguments resulted in an error b/c
of the lack of options.

Fixes NODE-1287
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.

3 participants