CollectionConfiguration
public struct CollectionConfiguration
The collection configuration that can be configured specifically for the replication.
-
The collection.
Declaration
Swift
public var collection: Collection?
-
The custom conflict resolver function. If this value is nil, the default conflict resolver will be used..
Declaration
Swift
public var conflictResolver: ConflictResolverProtocol?
-
Filter function for validating whether the documents can be pushed to the remote endpoint. Only documents of which the function returns true are replicated.
Declaration
Swift
public var pushFilter: ReplicationFilter?
-
Filter function for validating whether the documents can be pulled from the remote endpoint. Only documents of which the function returns true are replicated.
Declaration
Swift
public var pullFilter: ReplicationFilter?
-
Channels filter for specifying the channels for the pull the replicator will pull from. For any collections that do not have the channels filter specified, all accessible channels will be pulled. Push replicator will ignore this filter.
Note
Note:Channels are not supported in Peer-to-Peer and Database-to-Database replication.Declaration
Swift
public var channels: Array<String>?
-
Document IDs filter to limit the documents in the collection to be replicated with the remote endpoint. If not specified, all docs in the collection will be replicated.
Declaration
Swift
public var documentIDs: Array<String>?
-
Initializes the configuration.
Declaration
Swift
@available(*, deprecated, message: "Use init(collection:﹚ instead.") public init()
-
Initializes the configuration with the specified collection.
Declaration
Swift
public init(collection: Collection)
Parameters
collection
The collection.
-
Creates an array of
CollectionConfiguration
objects from the given collections.Each collection is wrapped in a
CollectionConfiguration
using default settings (no filters and no custom conflict resolvers).This is a convenience method for configuring multiple collections with default configurations. If custom configurations are needed, construct
CollectionConfiguration
objects directly instead.Declaration
Swift
public static func fromCollections(_ collections: [Collection]) -> [CollectionConfiguration]
Parameters
collections
An array of
Collection
objects to configure for replication.Return Value
An array of
CollectionConfiguration
objects corresponding to the given collections.