私はnode.jsとmongo dbが初めてです。私がやろうとしているのは、index.js から model.js の順序付き関数を呼び出すことですが、不満があります
オブジェクト関数 model() には、ordered() メソッドがありません
ルート/index.js
var pics_ = models.Picture.ordered();
model.js
Picture.prototype.ordered = function() {
var ordered = mongoose.Picture.find().sort({points:-1}).toArray()
console.log(ordered);
return ordered;
};