diff --git a/lib/options/SchemaNumberOptions.js b/lib/options/SchemaNumberOptions.js index c9b4c709e82..8ecc88988ef 100644 --- a/lib/options/SchemaNumberOptions.js +++ b/lib/options/SchemaNumberOptions.js @@ -48,6 +48,15 @@ Object.defineProperty(SchemaNumberOptions.prototype, 'max', opts); /** * If set, Mongoose adds a validator that checks that this path is strictly * equal to one of the given values. + * + * ####Example: + * const schema = new Schema({ + * favoritePrime: { + * type: Number, + * enum: [3, 5, 7] + * } + * }); + * schema.path('favoritePrime').options.enum; // [3, 5, 7] * * @api public * @property enum