Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Using array of array notation for sort triggers an error when followed by .toConstructor() #8159

Closed
MehdiSaffar opened this issue Sep 12, 2019 · 0 comments
Labels
confirmed-bug We've confirmed this is a bug in Mongoose and will fix it.
Milestone

Comments

@MehdiSaffar
Copy link

Query.prototype.sort() accepts array of arrays. When I add .toConstructor() it crashes saying

Invalid sort() argument, must be array of arrays
   at Query.sort (/xxx/node_modules/mquery/lib/mquery.js:1256:15)
   at Query.sort (/xxx/node_modules/mongoose/lib/query.js:2536:26)
   at Query.setOptions (/xxx/node_modules/mquery/lib/mquery.js:187:20)
   at Query.setOptions (/xxx/node_modules/mongoose/lib/query.js:1367:32)
   at model.Query.toConstructor (/xxx/node_modules/mongoose/lib/query.js:191:5)

NodeJS: v12.6.0
Mongoose: 5.7.0
MongoDB: irrelevant

@vkarpov15 vkarpov15 added this to the 5.7.2 milestone Sep 19, 2019
@vkarpov15 vkarpov15 added the needs repro script Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue label Sep 19, 2019
@vkarpov15 vkarpov15 added confirmed-bug We've confirmed this is a bug in Mongoose and will fix it. and removed needs repro script Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue labels Sep 22, 2019
vkarpov15 added a commit that referenced this issue Sep 22, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
confirmed-bug We've confirmed this is a bug in Mongoose and will fix it.
Projects
None yet
Development

No branches or pull requests

2 participants