title: how to update realm database if values already exists
body: <p>how to update values if it already exists in realm database ;
  I try to build an app to show some quotations from famous authors,
  the app will have some authors and every author will have some quotations ,
  when I run the app at the first time it run perfectly but when I try to run it again it show me values already exists error.<br>
  this is my model classes </p>
  
  <pre><code>public class Author extends RealmObject {
  @PrimaryKey
  private String name;
  private RealmList&lt;Quotes&gt;quote;
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public Author() {
  
  }
  
  public RealmList&lt;Quotes&gt; getQuote() {
      return quote;
  }
  
  public void setQuote(RealmList&lt;Quotes&gt; quote) {
      this.quote = quote;
  }
  
  public Author(String name, RealmList&lt;Quotes&gt; quote) {
  
      this.name = name;
      this.quote = quote;
  
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>public class Categories extends RealmObject {
  @PrimaryKey
  private String category;
  
  public String getCategory() {
      return category;
  }
  
  public void setCategory(String category) {
      this.category = category;
  }
  
  public Categories() {
  
  }
  
  public Categories(String category) {
  
      this.category = category;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>public class Quotes extends RealmObject {
  private String Quote;
  private Categories category;
  
  public Categories getCategory() {
      return category;
  }
  
  public void setCategory(Categories category) {
      this.category = category;
  }
  
  public String getQuote() {
      return Quote;
  }
  
  public void setQuote(String quote) {
      Quote = quote;
  }
  
  public Quotes() {
  
  }
  
  public Quotes(Categories category, String quote) {
  
      this.category = category;
      Quote = quote;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>this is my mainActivity where I set the DataBase and get the error:value already exists </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  Realm mRealm;
  Categories wisdom;
  Categories fear;
  Categories motivation;
  Categories life;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      RealmConfiguration configuration=new RealmConfiguration.Builder(this).build();
      Realm.setDefaultConfiguration(configuration);
      mRealm=Realm.getDefaultInstance();
  
      mRealm.beginTransaction();
  
  
      wisdom=mRealm.createObject(Categories.class);
      fear=mRealm.createObject(Categories.class);
      wisdom.setCategory("wisdom");
      fear.setCategory("fear");
      life.setCategory("Life");
      motivation.setCategory("Motivation");
  
      Author john_green=mRealm.createObject(Author.class);
      john_green.setName("John Green");
  
      Quotes john_green_1=mRealm.createObject(Quotes.class);
      john_green_1.setQuote("My thoughts are stars I can't fathom into constellations.");
      john_green_1.setCategory(motivation);
      john_green.getQuote().add(john_green_1);
  
      Quotes john_green_2=mRealm.createObject(Quotes.class);
      john_green_2.setQuote("What is the point of being alive if you don’t at least try to do something remarkable?");
      john_green_2.setCategory(motivation);
      john_green.getQuote().add(john_green_2);
  
      mRealm.commitTransaction();
  }
  </code></pre>
  
  <p>}</p>