Skip to content

Commit

Permalink
docs: add example to SchemaNumberOptions#enum
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 24, 2019
1 parent 979fb87 commit 7fae539
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/options/SchemaNumberOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7fae539

Please sign in to comment.