add<T extends RealmObject> method

Subscription add<T extends RealmObject>(
  1. RealmResults<T> query, {
  2. String? name,
  3. bool update = false,
})

Adds a query to the set of active subscriptions.

The query will be joined via an OR statement with any existing queries for the same type.

If a name is given, then this will be used to match with any existing query, otherwise the query itself is used for matching.

If update is specified to true, then any existing query will be replaced. Otherwise a RealmException is thrown, in case of duplicates. {@category Sync}

Implementation

Subscription add<T extends RealmObject>(RealmResults<T> query, {String? name, bool update = false}) {
  return Subscription._(realmCore.insertOrAssignSubscription(this, query, name, update));
}