title: How to retrieve a specific field from an entity using Morphia and Play framework in Java
body: <p>I have a big entity I created in Play! framework in Java and I would like to retrieve only a specific field from the database using Morphia and MongoDB. The entity itself is very big and contains many fields, so I would like to improve the performance of my application by retrieving only one field from it.</p>
  
  <p>I know it is possible but I can't figure out exactly how to do it...<br>
  Here are some of the fields I have in my class <code>Shop</code>:</p>
  
  <pre><code>public String imagePath;
  public String profileImagePath;
  public String Motto;
  @Reference
  public Category primeCategory;
  public boolean isOnline;
  </code></pre>
  
  <p>As you can see, the <code>primeCategory</code> field is a <code>Category</code> entity which I want to retrieve.
  I saw something which suppose to achieve that in Morphia's website:</p>
  
  <pre><code>Datastore ds = null; 
  
  Shop shop = ds.createQuery(Shop.class).retrievedFields(true, "primeCategory").get();
  </code></pre>
  
  <p>I'm not sure what exactly do I'm getting here.  </p>
  
  <p>It would be great if someone could explain to me if this is the way and how exactly I should do it, as well as provide an example.</p>