Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose unique validator

npm install --save mongoose-unique-validator


var mongoose = require('mongoose');
var uniqueValidator = require('mongoose-unique-validator');
 
var mySchema = mongoose.Schema(/* put your schema definition here */);
mySchema.plugin(uniqueValidator);
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #mongoose #unique #validator
ADD COMMENT
Topic
Name
5+9 =