I have the following object in my mongo database named music.
I want to update where the genre is Grunge
The band name is Nirvana
The album name is Nevermind
The track order is 1
and change the track's name to "Smells Like Teen Spirit!".
I've tried playing with the positional operator, but can't quite
figure this 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
} ]
} ]
} ]
}