A Realm instance is the main entry point for interacting with a persisted realm.
Types Functions Properties See also
Close this Realm and all underlying resources. Accessing any methods or Realm Objects after this method has been called will then an
Returns the current number of active versions in the Realm file. A large number of active versions can have a negative impact on the Realm file size on disk.
Check if this Realm has been closed or not. If the Realm has been closed, most methods will throw
IllegalStateException if called.
Returns the results of querying for all objects of a specific type.
Observe changes to the Realm. If there is any change to the Realm, the flow will emit the updated Realm. The flow will continue running indefinitely until canceled.
Returns the Realm version of this object. This version number is tied to the transaction the object was read from.
Modify the underlying Realm file in a suspendable transaction on the default Realm Write Dispatcher.
Modify the underlying Realm file while blocking the calling thread until the transaction is done. Write transactions automatically commit any changes made when the closure returns unless
MutableRealm.cancelWrite was called. Properties
Configuration used to configure this Realm instance.