3.0: findOneAndUpdate is still using the old sort() syntax #1058

Closed
powmedia opened this Issue Aug 17, 2012 · 0 comments

Projects

None yet

2 participants

@powmedia

Just switched to 3.0, thanks for the great work.

I'm using the new sort('-property') syntax for main queries but noticed that findOneAndUpdate() requires the sort option to be passed an object as in 2.x, e.g.:

Post.findOneAndUpdate(conditions, update, { sort: { author: -1 } }, cb);

It doesn't work as expected if passed the new sort string style.

@aheckmann aheckmann closed this in 6aa5f27 Aug 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment