title: Clean up old Realm objects?
body: <p>Is there a simple way to delete old data from a Realm database? Like if some object has one day stored <strong>automatically</strong> delete it?</p>
  <p>The alternative could be to add a field with the date and extract and compare it to decide if delete, but <strong>the question is if Realm has a method itself to achieve this</strong>.</p>
  <h2>I'm not looking for a query</h2>
  <p>The question is whether there is any other way to <strong>automatically</strong> remove old objects from Realm, such as a condition when we store data, a parameter, a <strong>configuration</strong> or a Realm method, <strong>and not just compare each time</strong>. <em><strong>It is obvious that with a query we can eliminate any object
  that we want.</strong></em></p>
  <p>I already saw some similar questions (<a href="https://stackoverflow.com/questions/33641221/realm-cleaning-up-old-objects">like this one</a>) about this, <strong>but none for Android</strong>
  <strong>(or Java)</strong>, in the <a href="https://realm.io/docs/java/latest" rel="nofollow noreferrer">Realm docs</a> the only similar approach I found is
  about <a href="https://realm.io/docs/java/latest/#migrations" rel="nofollow noreferrer">migrations.</a></p>
  <p>The specification of the linked question (<strong>not the answer</strong>), is just to clarify that this is not a Swift-based question and not mark it as duplicate at first glance.</p>