I have this user object:
{
created: 2131092323,
myClub : {
balance : 1000,
fans : 1000,
myPlayers : [{
playerName : 'gogo',
stamina : 70
},
{
playerName : 'gogo8',
stamina : 80
}]
}
}
and this query to update:
users.update(
{ _id : user._id },
{
$set: {
'myClub.balance' : 1000,
'myClub.fans' : 1,
'myClub.myPlayers.$.stamina' : 50
}
},
{ upsert : true },
function(){
someCallback()
}
);
The inner array named myPlayers is not updating, am i missing something here? Should i had anything in the params of the update statement?