add missing field to mongoose document (#39226)

This commit is contained in:
thejavascriptman
2019-10-18 15:38:35 -07:00
committed by Andrew Branch
parent ed4c578fb0
commit c35210fe19
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -1421,6 +1421,8 @@ declare module "mongoose" {
isNew: boolean;
/** The documents schema. */
schema: Schema;
/** Empty object that you can use for storing properties on the document */
$locals: { [k: string]: any };
}
interface MongooseDocumentOptionals {
+1
View File
@@ -732,6 +732,7 @@ mongoose.plugin<PluginOption>(AwesomeLoggerPlugin, {modelName: 'Executive', time
*/
var doc = <mongoose.MongooseDocument> {};
doc.$isDefault('path').valueOf();
doc.$locals.field = 'value';
const docDotDepopulate: mongoose.MongooseDocument = doc.depopulate('path');
doc.equals(doc).valueOf();
doc.execPopulate().then(function (arg) {