Well it seems that as soon as I pass one hurdle I immediately run into another, much higher one. I’ve gotten almost everything working in the voting app, chart and all, but I can’t seem to update the value of my votes array in the database. Not only that, but I’m not sure as to which method I should use (find, findOne, findOneAndUpdate, or just update).
This is my votes model:
const pollSchema = new Schema({
user: {
name: String,
question: String,
choices: Array
},
date: Date,
votes: Array
})
By default the array is filled with 0’s, and the elements correspond to the choices array.