Subscription

interface Subscription

A subscription defines a specific server query and its metadata. The result of this query is continuously being synchronized with the device as long as the subscription is part of a SubscriptionSet with a state of SubscriptionSetState.COMPLETE.

Subscriptions can be updated using MutableSubscriptionSet.add with updateExisting = true.

Properties

Link copied to clipboard
abstract val createdAt: RealmInstant

The timestamp for when this subscription was created.

Link copied to clipboard
abstract val id: ObjectId

An unique id, generated by Realm, that identifies this subscription.

Link copied to clipboard
abstract val name: String?

The name of subscription or null if this is an anonymous subscription.

Link copied to clipboard
abstract val objectType: String

The class name of the objects being queried.

Link copied to clipboard
abstract val queryDescription: String

The subscription query that is running on objects of type objectType.

Link copied to clipboard
abstract val updatedAt: RealmInstant

The timestamp for when a persisted subscription was updated. When the subscription is created, this field is equal to createdAt.

Functions

Link copied to clipboard
abstract fun <T : RealmObject> asQuery(type: KClass<T>): RealmQuery<T>

Converts the Subscription.queryDescription back to a RealmQuery that can be executed against the local Realm.

Link copied to clipboard

Converts the Subscription.queryDescription back to a RealmQuery that can be executed against the local Realm.