title: Spring Data Mongo - Exclude fields in query from object referenced by @DbRef
body: <p>Say I have two classes as follows:</p>
  
  <pre><code>public class Person {
  
      private String personId;
  
      private String name;
  
      private Address address;
  
  }
  
  public class Order {
  
      private String orderId;
  
      @DbRef
      private Person customer;
  
  }
  </code></pre>
  
  <p>What I would like to do is run a query against the Order collection but only return specific fields of the linked Person object, something like:</p>
  
  <pre><code>public Order findByOrderId(String orderId) {
      Query query = query(where("orderId").is(orderId));
      query.fields().exclude("person.address");
      return operations.findOne(query,Order.class);
  }
  </code></pre>
  
  <p>I get the data returned but my exclude argument doesn't seem to be applied if it is across a child object linked via @DbRef. I can exclude attributes of the Order object no problem. The problem I have is that the Person document may get quite large and I want to have control over the network traffic when getting Order objects (i.e. only get data as I need it).</p>
  
  <p>I am using version 1.0.0.M5 of spring-data-mongodb</p>
  
  <p>Does anyone know if this kind of operation is supported?</p>
  
  <p>Many thanks</p>
  
  <p>Joe</p>