title: Spring Data MongoDB - Embedded Document as Reference in Other Document
body: <p>I'd like to know if it's possible (or even correct) to use embedded documents as reference in other documents.</p>
  
  <p>I know I can move the embedded document to its own collection but the main goal is to have the performance benefit of embedded document and also avoid duplication.</p>
  
  <p>For example:</p>
  
  <p><strong>User</strong></p>
  
  <pre><code>{
      _id: ObjectId("4fed0591d17011868cf9c982"),
      _class: "User"
      ...
      addresses: [ {
          _id: ObjectId("87KJbk87gjgjjygREewakj86"),
          _class: "Address",
          ...
      } ]
  }
  </code></pre>
  
  <p><strong>Order</strong></p>
  
  <pre><code>{
      _id: ObjectId("gdh60591d123487658cf9c982"),
      _class: "Order",
      ...
      address: ObjectId("87KJbk87gjgjjygREewakj86")
  }
  </code></pre>