mongoid/mongoid — Issue #1417: only and within do not work on nested docs?
Author: prinzC
Created: 2011-11-09 01:22:57+00:00
State: open

I've got the document (book with nested chapters with nested sections):

book: {:title: "Book Title", "chapters":[{title: "Chapter I", "sections":[{},{}] }, {...} ]}

If I want to get book without chapters I say
books[0].without("chapters").chapters ==> [] #i've got empty array

books[0].chapters[0].without("sections").sections ==> [.....] # I've got full array