This is my schema:
{
_id: \"FJwSEMdDriddXLKXh\"
name: \"t\"
number: \"5\"
owners: [
{
_id: 1,
name: \"Name\",
address:
There is mistake in your query in owners
field:
Territories.update({
_id: template.data._id,
owners: {
$elemMatch: {
_id: this._id
}
},
{
$push: {
'owners.$.notes': {
title: "First Title"
}
}
})
You won't be able to update directly from client side, because you use owners
field and only _id
is allowed. To solve this you can update using Meteor.methods
and call that method from client side.