Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose validate array of references required

questionSchema.path('options')
    .validate((val) -> val.length > 1, 'Must have minimum two options');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongoose #validate #array #references #required
ADD COMMENT
Topic
Name
8+2 =