Hello
I have a projects model with just a name field and in it also the embedded relation to line_items. class Project include mongoid::document field :name embeds_many :line_items end
class LineItem
include mongoid::document
field :title
embedded_in :project, :inverse_of => :line_items
end
I suppose this is more of the mongo driver question: if I had such a document
db.project.find()[0]
{
_id : 123,
name : "housework",
line_items:[
{ title : "clean fridge", _id : 601},
{ title : "clean tub", _id : 602},
{ title : "clean oven", _id : 603}
]
}
- 1) How do I update say the line item with id 601 in mongo console?
- 2) how do I delete it?
Thanks!