Realm v10.0.0-RC.1 Release Notes
Release Date: 2020-10-02 // over 3 years ago-
๐ We no longer support Realm Cloud (legacy), but instead the new MongoDB Realm Cloud. MongoDB Realm is a serverless platform that enables developers to quickly build applications without having to set up server infrastructure. MongoDB Realm is built on top of MongoDB Atlas, automatically integrating the connection to your database.
๐จ The old Realm Cloud legacy APIs have undergone significant refactoring. The new APIs are all located in the
io.realm.mongodb
package withio.realm.mongodb.App
as the entry point.๐ฅ Breaking Changes
- ๐ From now on it is not allowed by default to run transactions with either
Realm.executeTransaction()
orDynamicRealm.executeTransaction()
from the UI thread. Doing so will yield aRealmException
. Users can override this behavior by usingRealmConfiguration.Builder.allowWritesOnUiThread(true)
when building aRealmConfiguration
to obtain a Realm or DynamicRealm instance, though we do not recommend doing so. Instead, we recommend usingexecuteTransactionAsync()
or, alternatively, using non-UI threads when callingexecuteTransaction()
for bothRealm
s andDynamicRealm
s.
โจ Enhancements
- ๐ Users can now opt out from allowing queries to be launched from the UI thread by using
RealmConfiguration.Builder.allowQueriesOnUiThread(false)
. ARealmException
will be thrown when callingRealmQuery.findAll()
,RealmQuery.findFirst()
,RealmQuery.minimumDate()
,RealmQuery.maximumDate()
,RealmQuery.count()
,RealmQuery.sum()
,RealmQuery.max()
,RealmQuery.min()
,RealmQuery.average()
andRealmQuery.averageDecimal128()
from the UI thread after having usedallowQueriesOnUiThread(false)
. Queries will be allowed from the thread from which the Realm instance was obtained as it always has been by default, although we recommend usingRealmQuery.findAllAsync()
orRealmQuery.findFirstAsync()
, or, alternatively, using a non-UI thread to launch them. - 0๏ธโฃ
BaseRealm.refresh()
will throw aRealmException
if it is being called from the UI thread ifallowQueriesOnUiThread
is set tofalse
, though it will be allowed by default. - โ Added
DynamicRealm.executeTransactionAsync()
. - โ Added Kotlin extension suspend function
Realm.executeTransactionAwait()
which runs transactions inside coroutines. - โ Added Kotlin extension function
RealmResults.toFlow()
which returns a Kotlin flow, similar to our RxJava convenience methodasFlowable()
. - โ Added Kotlin extension function
RealmList.toFlow()
which returns a Kotlin flow, similar to our RxJava convenience methodasFlowable()
. - โ Added Kotlin extension function
RealmModel.toFlow()
which returns a Kotlin flow, similar to our RxJava convenience methodasFlowable()
.
๐ Fixed
- โก๏ธ Using
Realm.copyToRealmOrUpdate()
andRealm.insertOrUpdate()
did not correctly update objects if they contained lists of embedded objets. Instead of replacing the original list, list items was appended to the original list. Note, some corner cases are still not supported. See #7138 for more information. (Issue #7131, since 10.0.0-BETA.1).
Compatibility
- โฌ๏ธ File format: Generates Realms with format v20. Unsynced Realms will be upgraded from Realm Java 2.0 and later. Synced Realms can only be read and upgraded if created with Realm Java 10.0.0-BETA.1.
- ๐ APIs are backwards compatible with all previous release of realm-java in the 10.x.y series.
- Realm Studio 10.0.0 and above is required to open Realms created by this version.
Internal
- โก๏ธ Updated to Object Store commit: ef6736cc07a8b94d1242c522969114bb8047deef
- โก๏ธ Updated to Realm Sync 10.0.0-beta.14.
- โก๏ธ Updated to Realm Core 10.0.0-beta.9.
- ๐ From now on it is not allowed by default to run transactions with either