I have such a mongoose model:
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
let schema = new Schema({
test: String
}, {
collection: "test"
});
let model = mongoose.model("TestModel", schema);
How to get the name of the collection if in the callback I have access only to the reference link.
Expecting something like:
model.getCollectionName();
source
share