【发布时间】:2017-09-06 00:01:48
【问题描述】:
我有一个像这样的猫鼬模型:
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
let schema = new Schema({
test: String
}, {
collection: "test"
});
let model = mongoose.model("TestModel", schema);
如果在回调中我只能访问“模型”引用,我如何检索集合名称。
期待类似:
model.getCollectionName();
【问题讨论】: