I have trouble understanding the syntax of updateOne and insertOne. I know if I don't have a field I can use updateOne and use $set to create a field. But I have an example here
const listSchema=new mongoose.Schema({
name:String,
items:Array
});
const List=mongoose.model("List",listSchema);
const list =new List({
name: "fruits",
items:[]
});
so essentially I already made the field, but I would like to add items into list.items array, so in this case do I use update or insert? And can you tell me some general knowledge about when to use insert and when to use update? Thank you!