Skip to content
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

Post-update callback broken on client #1

Closed
wizonesolutions opened this issue Jun 6, 2013 · 1 comment
Closed

Post-update callback broken on client #1

wizonesolutions opened this issue Jun 6, 2013 · 1 comment

Comments

@wizonesolutions
Copy link
Contributor

Investigating the issue more deeply; stand by.

@wizonesolutions
Copy link
Contributor Author

OK, root cause is:

result = directUpdate.call(this, selector, modifier, options, callback);

This always passes callback as undefined if there is no options parameter. What we need to do is to use apply instead and trim undefineds off the end of the array (but not undefineds between arguments, which are valid if we want to skip arguments).

So the workaround would be to call CollectionName.update(selector, modifier, undefined, function(err, res) { // etc }); Otherwise, callbacks don't work.

I will test my fix and then submit a pull request.

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

No branches or pull requests

1 participant