title: How deep should I embed with Mongoid?
body: <p>Hi I'm new to mongoDB and Mongoid and am little bit confused on when to use embedded documents and how deep to embedd.</p>
  
  <p>So a fictional example:</p>
  
  <p><code>Library collection has_many :books, which embeds_many :pages, which embeds_many :sections</code></p>
  
  <p>Since I cannot work with say a Section directly I have to go trough books.pages.sections, right?</p>
  
  <p>This would result in this route, <code>libraries/:id/books/:id/pages/:id/sections/:id</code>
  Which seems a little bit crazy, best practice would be to only nest one level deep, right?
  One way would be to have the route <code>pages/:id/sections/:id</code> and then stick the bookid in the request?</p>
  
  <p>Would it be harder to query on say, sections? For example if I need to find all the books where sections has tag x? </p>
  
  <p>However if I don't embedd all the way I would have an extra query?</p>
  
  <p>Can someone shed some light? Thanks.</p>