title: MongoDB Schema Design ordering service
body: <p>I have the following objects Company, User and Order (contains orderlines). User's place orders with 1 or more orderlines and these relate to a Company. The time period for which orders can be placed for this Company is only a week.</p>
  
  <p>What I'm not sure on is where to place the orders array, should it be a collection of it's own containing a link to the User and a link to the Company or should it sit under the Company or finally should the orders be sat under the User.</p>
  
  <p>Numbers wise I need to plan for 50k+ in orders.</p>
  
  <p>Queries wise, I'll probably be looking at Orders by Company mainly but I would need to find an Order by Company based for a specific user.</p>