node.js - Default values in array mongoose -
i trying make default values array in mogoose schema:
warning: type: array default: [10, 50, 99]
am right in such decision or there other way this?
regarding mongoose-documentation, way correct.
here small example:
var arraytestschema = new schema({ anarray: { type: array, 'default': [1, 2, 3] } });
and link related documentation page: http://mongoosejs.com/docs/2.7.x/docs/defaults.html
Comments
Post a Comment