I have a mongo doc with an object that holds two arrays of id's
Musics {
_id: ""evsdfbsfb"
name: "muh jams"
playlists: {
type1: ["dfngdfgnd", "dfgdfgn"]
type2: ['dfgndfndgn','dndgndgndgnd"]
}
}
I've tried pushing an id like so
let music = await MusicModel.findOneAndUpdate({_id:input.music}, { playlists: { "$push": { "type1" : type1._id }}}, {new: true})