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