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
Model.create(Array) promise is spreading arguments #2582
Comments
3.8.x always returns them as a spread, 3.9.x (and 4.0) will return them as an array if you pass an array and spread if you pass in a spread. The reasoning for this is that it's a backwards breaking change, so needs to be in the unstable branch. 4.0 is currently waiting on MongoDB server 2.8 and MongoDB node driver 2.0 to stabilize before releasing. |
got it. thanks |
I created an issue about this regarding the callback as well #2602 |
oy this came back and bit me again. For anyone who stumbles upon this, Q and Mongoose basically have opposing philosophies (until 3.9/4.0). if you convert |
Yeah Q doesn't support resolving with a spread, but mongoose's underlying library |
Actually what just occurred to me is that I could use |
@vkarpov15 mentions in #2478 that if you pass an array to
Model.create
, the promise is resolved with an array. However, [in the docs](http://mongoosejs.com/docs/api.html#model_Model.create it looks like the arguments are spread, and my code is showing the same. Would love some clarification here if possibleThe text was updated successfully, but these errors were encountered: