我有这样一个mongoose 模型:
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
let schema = new Schema({
test: String
}, {
collection: "test"
});
let model = mongoose.model("TestModel", schema);
如果在回调中我只能访问"model"引用,如何检索集合名称.
期待类似于:
model.getCollectionName();