Hello, I would like to insert data into "rss" array. How can I do this? That's how I add new categories into users collection:
user.findOneAndUpdate({
_id: req.body.ownerId
},
{ $push: {
categories: {
name: req.body.categoryName,
public: false
}
}},
{ safe: true, upsert: true },
function(err, model) {
console.log(err);
});
But how can I add something into Sport/rss? Firstly I need to find an user by id and secondly I need to find a category also by id. How to do that and finally insert into?
my variables:
req.body.ownerId - user id
req.body.categoryId - category id
req.body.url - rss url which I want to insert into categories array
Thanks for you help.
