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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -