私がやろうとしていることは次のようなものです:
A_Schema.statics.init = function init() {
A_Schema.find({}, {}, {
}, function (error, docs) {
if (!error) {
console.log('There is no error.');
}
else {
console.log(error);
}
});
};
つまり、A_Schema
モデルの find メソッドを使用していますが、クラッシュし続けます。
内部A_Schema
はスキーマではなく適切に定義されたモデルでなければならないためだと思いますが、その方法がわかりません。
私はすでに試しました:
A_Schema.statics.init = function init() {
mongoose.model('A_Schema', A_Schema).find({}, {}, {
}, function (error, docs) {
if (!error) {
console.log('There is no error.');
}
else {
console.log(error);
}
});
};
と
A_Schema.statics.init = function init() {
mongoose.model('A_Schema').find({}, {}, {
}, function (error, docs) {
if (!error) {
console.log('There is no error.');
}
else {
console.log(error);
}
});
};
しかし、それはクラッシュし続けます。
手伝って頂けますか?
前もって感謝します
ディオスニー