Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

How to sort in mongoose?

Asked by Virginia Mathis Jul 18, 2021 1.4K views 1 answer
Share

About this question

 I find no doc for the sort modifier. The only insight is in the unit tests: spec.lib.query.js#L12
writer.limit(5).sort(['test', 1]).group('name')

But it doesn't work for me:

Post.find().sort(['updatedAt', 1]);

Dont know mongoose sort?

Your answer

1 Answer

More Devops discussions