WaitForSync

enum WaitForSync : Enum<WaitForSync>

Enum defining the behaviour of when RealmQuery.subscribe and RealmResults.subscribe will return a query result.

When the Subscription is created for the first time, data needs to be downloaded from the server before it becomes available, so depending on whether you run the query against the local database before or after this has happened, you query results might not look correct.

This enum thus defines the behaviour of when the query is run, so it possible to make the appropriate tradeoff between correctness and availability.

See also

Entries

NEVER
Link copied to clipboard

With this mode enabled, Realm will always query the local database first while any server data is being downloaded in the background. This update is not binary, which means that if you register a flow on the query result, you might see multiple events being emitted as the database is being filled based on the subscription.

ALWAYS
Link copied to clipboard

With this mode enabled, Realm will always download the latest server state before running the local query. This means that your query result is always seeing the latest data, but it also requires the app to be online.

FIRST_TIME
Link copied to clipboard

This mode will wait for the server data the first time a subscription is created before running the local query. Later calls to io.realm.kotlin.mongodb.ext.subscribe will detect that the subscription already exist and run the query immediately.

Properties

name
Link copied to clipboard
val name: String
ordinal
Link copied to clipboard
val ordinal: Int