Hi there
Iโm building a music player app The feature Iโm trying to implement is the ability for users to create playlists and add songs to their playlists
here is playList object scheme
at Song param instead of storing one song object i wanted it to be an array of songs object
i tried using
playlist.add("Song", newSong)
but ended up with this error
Cannot add elements to a non-array value
my code
const addSongToPlayList = async (song) => {
song.add("Song", {currentSong})
await song.save();
console.log("the added song", song)
}
any idea on how i can do this