title: Spring boot mongo - How to refer to document in other collections from a collection
body: <p>I have Office object:</p>
  
  <pre><code>class Office{
     String address;
     int employees;
     String city;
     String State;
     ---- lot of other fields
  }
  </code></pre>
  
  <p>I have <code>mongo</code> collections for Office class that have lets say 100 Office documents represented by above Office class. </p>
  
  <p>Then I have Employee class:</p>
  
  <pre><code>class Employee{
     String firstName;
     String lastName;
     Office office;
     -----other fields
  }
  </code></pre>
  
  <p>In mongo collection for Employee class how I can prevent Office object to be copied for each Employee entry. </p>
  
  <p>In <code>spring-boot mongodb</code> is there way I can refer to Office collection to represent Office object of Employee instead of copying it for each employee in mongo db. I hope I have explained my problem.</p>
  
  <p>Thanks in advance.</p>