Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Mongoose make Array required

const ToyBoxSchema = new Schema({
  toys: {
    type: [ToySchema],
    default: undefined
    required: true,
  }
});
Source by mongoosejs.com #
 
PREVIOUS NEXT
Tagged: #Mongoose #Array #required
ADD COMMENT
Topic
Name
5+2 =