Quantcast
Channel: Active questions tagged mongodb-atlas - Stack Overflow
Viewing all articles
Browse latest Browse all 271

Realm Error No Subscription for WRITE: When doing multiple subscriptions of different type

$
0
0

I am trying to configure the realm with the help of the below function. Initially, there was only EmailAccount class after adding ApplicationAccount class while writing to EmailAccount cluster it is working but for ApplicationAccount it is saying Cannot write to class ApplicationAccount when no flexible sync subscription has been created.

How to solve this ??

override fun configureTheRealm() {        if (user != null) {            val config = SyncConfiguration.Builder(user, setOf(EmailAccount::class, ApplicationAccount::class))                .initialSubscriptions { sub ->                    add(                        query = sub.query<EmailAccount>("ownerId == $0", user.id),                        name = "User's EmailAccounts"                    )                    add(                        query = sub.query<ApplicationAccount>("ownerId == $0", user.id),                        name = "User's Application Account"                    )                }                .log(LogLevel.ALL)                .build()            realm = Realm.open(config)            Log.d("USERID", "$user")        }    }

I have already tried terminating the sync and then enabling it again. But the same error is happening.


Viewing all articles
Browse latest Browse all 271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>