I want to pass my array of string to my schema. As you can see in auth.js image:image here I am passing my image array to my mongodb property image and i am getting array of strings successfully in image but I tried everything like $push, $each but i don't know how to pass the image array to my Mongodb schema. I hope you understand my query.
Schema.js
const mongoose=require('mongoose');
const mySchema=mongoose.Schema({
image:{
type:[String],
required:true,
value:[String]
}
})
const MyCattle=mongoose.model('cattle_list',mySchema);
auth.js
const finaldata = new MyCattle({
image:[image]
})
module.exports=MyCattle;