From 6d2d24d72a5bb5dce3cd39c707028c2ba2d3485e Mon Sep 17 00:00:00 2001 From: Louy Alakkad Date: Tue, 9 Aug 2016 21:03:19 +0100 Subject: [PATCH] Adding Model.modelName and Model.collection See: https://github.com/Automattic/mongoose/blob/5c490f99e5d281e5303c023bade93a0624e5db66/lib/model.js#L62-L88 --- mongoose/mongoose.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 45c218a94c..3b6590feda 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -2059,6 +2059,15 @@ declare module "mongoose" { */ new(doc?: Object): T; + /** The name of the model. */ + modelName: string; + + /** Collection the model uses. */ + collection: Collection; + + /** If this is a discriminator model, `baseModelName` is the name of the base model. */ + baseModelName: string; + /** * Finds a single document by its _id field. findById(id) is almost* * equivalent to findOne({ _id: id }). findById() triggers findOne hooks.