Hi
I am trying to update an embedded array object within a document but
am having no success.
If I have the following structure:
[{name:Mark,pets:[{type:dog,name:'fido'},{type:'cat',name:'puss'}]},
{name:'John',pets:[{type:dog,name:'rex'}]}]
How can I change the name of Mark's dog?
I have tried positional operator stuff but no luck
e.g. t.update( {'name':'Mark',pets.type:'dog'}, {$set:{'pets.
$.name':'rover'}}
Using array positioning does work but I don't know the index e.g.
t.update( {'name':'Mark',pets.type:'dog'}, {$set:{'pets.
1.name':'rover'}}
Thanks