Node.js mongoose: how to use the .in and .sort methods of a query?
- by Chris
Hi there,
I'm trying to wrap my head around mongoose, but I'm having a hard time finding any kind of documentation for some of the more advanced query options, specifically the .in and .sort methods. What's the syntax for sorting, for example, a Person by age?
db.model("Person").find().sort(???).all(function(people) { });
Then, let's say I want…