add array of objects to mongodb object code example
Example 1: mongodb add to array if not exists
db.tags.update(
{name: 'sport'},
{$addToSet: { videoIDs: "34f54e34c" } }
);
Example 2: insert item into list mongodb
db.col.update(
{ name: 'doc', 'list.id': 2 },
{$push: {'list.$.items': {id: 5, name: 'item5'}}}
)