QuerySubscription
@frozen
public struct QuerySubscription<T> where T : RealmSwiftObject
SubscriptionQuery
is used to define an named/unnamed query subscription query, which
can be added/remove or updated within a write subscription transaction.
-
Creates a
QuerySubscription
for the given type.Declaration
Swift
public init(name: String? = nil, query: QueryFunction? = nil)
Parameters
name
Name of the subscription.
query
The query for the subscription, if nil it will set the query to all documents for the collection.
-
Creates a
QuerySubscription
which subscribes to all documents of the given type. -
Creates a
QuerySubscription
for the given type.Declaration
Swift
public init(name: String? = nil, query: borrowing QueryFunction)
Parameters
name
Name of the subscription.
query
The query for the subscription.
-
Creates a
QuerySubscription
for the given type.Declaration
Swift
public init(name: String? = nil, where predicateFormat: String, _ args: Any...)
Parameters
name
Name of the subscription.
predicateFormat
A predicate format string, optionally followed by a variable number of arguments, which will be used to create the subscription.
-
Creates a
QuerySubscription
for the given type.Declaration
Swift
public init(name: String? = nil, where predicate: NSPredicate)
Parameters
name
Name of the subscription.
predicate
The predicate defining the query used to filter the objects on the server..