Wednesday, 17 June 2020

how can i save in object or array in mongoose

This is SchemaPost:{ year_2017:[ { day:{ type:Number, required: true }, title:{ type:String, required: true }, date:{ type: String, requred: true }, description:{ type: String, required: true }, year:{ type:Number, required:true } } ], year_2018:[ { day:{ type:Number, required: true }, title:{ type:String, required: true }, date:{ type: String, requred: true }, description:{ type: String, required: true }, year:{ type:Number, required:true } } ], } if my condition is true i want to save in year_2017 object if my condition is false then it should save in year_2018

Submitted June 17, 2020 at 10:51AM by mtkxvx

No comments:

Post a Comment