addReplicationSubscription

fun addReplicationSubscription(query: String, arguments: Map<String, Any>? = null): DittoReplicationSubscription

Installs and returns a replication subscription for a query, configuring Ditto to receive updates from other peers for documents matching that query. The given query must be a SELECT query, otherwise a DittoError.StoreError with DittoError.StoreErrorReason.QueryNotSupported is thrown.

Return

An active DittoReplicationSubscription for the given query and arguments that can be used to close the subscription. Otherwise, the subscription will remain active until the Ditto instance goes out of scope.

Since

4.5.0

Throws

if there is a problem creating or registering the subscription.