My model:
Restaurant = mongoose.Schema(
name: String
menuItems: [
name: String
dishes: [
name: String
]
]
)
I'll need to push item to 'dishes' array:
Restaurant.update {id: restID, 'menuItems.id': menuItemID}
$addToSet: {'menuItems.$.dishes': newDish}
(err, res) ->
...
But nothing happens. What I'm doing wrong? Thanks for any advise.