I have the following object in my mongo database named music.
I want to update where the grunge genre is
Band Name - Nirvana
Album Title - Nevermind
Track order - 1
and change the name of the track to "Smells Like Teen Spirit!"
I tried playing with a positional operator, but I canβt figure it out.
{ genre : "Grunge", bands : [ { name : "Nirvana", albums : [ { name : "Nevermind", tracks : [ { name : "Smell Like Teen Spirit", order : 1, duration : 301 }, { name : "In Bloom", order : 2, duration : 254 } ] }, { name : "In Utero", tracks : [ { name : "Server the Servants", order : 1, duration : 216 }, { name : "Scentless Apprentice", order : 2, duration : 254 } ] } ] }, { name : "Karma++ : A Nirvina Tribute Band", albums : [ { name : "Nevermind", tracks : [ { name : "Smell Like Teen Spirit", order : 1, duration : 301 }, { name : "In Bloom", order : 2, duration : 254 } ] }, { name : "In Utero", tracks : [ { name : "Server the Servants", order : 1, duration : 216 }, { name : "Scentless Apprentice", order : 2, duration : 254 } ] } ] } ] }
source share