1
일련의 나는 그런 일을 할 수있는 문서에 따르면몽구스 : 사용자 정의 인스턴스
var animalSchema = new Schema({ name: String, type: String });
animalSchema.methods.findSimilarTypes = function (cb) {
return this.model('Animal').find({ type: this.type }, cb);
}
가정하자 나는 또 다른 기능을 가지고 :
animalSchema.methods.owner
하는 필터가 검색 쿼리를 수정 있도록 animalScheme.owner
가, XYZ 경우 ~ {..., owner: xyz}
순차적으로 인스턴스를 사용할 수 있습니까? 어떻게 이것을 할 수 있습니까?
var animalSchema.findSimilarTypes().owner("xyz") ?
어떤 힌트일까요?