I have the following Schemas in Mongoose/Node.js:
var ItemsSchema = new Schema({
itemname: String,
quantity: String
});
var ListSchema = new Schema({
listname: String,
items: [ItemsSchema]
});
var UsersSchema = new Schema ({
username: String,
owned: [ListSchema]
});
So each User may have many Lists. And each list can contain many items. How can i insert new item to a specific list? Using User.findOne({"owned._id" : listid} ... will give me the user that own the specific list but i can't figure it out how to proceed to get the single list.
Thanks in advice!