Adding Model.modelName and Model.collection

See:
https://github.com/Automattic/mongoose/blob/5c490f99e5d281e5303c023bade93a0624e5db66/lib/model.js#L62-L88
This commit is contained in:
Louy Alakkad
2016-08-21 14:11:33 -04:00
committed by Simon
parent 11b67e8ad3
commit 6d2d24d72a
+9
View File
@@ -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.