Interface: StackSyncOptions
Defined in: client/lib/core/sync/index.d.ts:49
Options for ClientStack.sync.
Everything except remote has a working default; the defaults describe a
continuous, self-healing, internal-documents-excluded sync.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
batchesLimit? | number | Concurrent batches. Passed to PouchDB as batches_limit. | client/lib/core/sync/index.d.ts:61 |
batchSize? | number | Documents per batch. Passed to PouchDB as batch_size. | client/lib/core/sync/index.d.ts:59 |
checkSchemaVersion? | boolean | Refuse to start when the remote was last written by a newer schema. Defaults to true. See SyncSchemaMismatchError. | client/lib/core/sync/index.d.ts:98 |
classes? | ClassFilterOptions | Which classes replicate. See ClassFilterOptions - an allow-list keeps the data model automatically, and relations are judged by their endpoints. Example stack.sync({ remote, classes: { exclude: ["Draft"] } }); | client/lib/core/sync/index.d.ts:75 |
direction? | SyncDirection | Direction of travel. Defaults to "both". | client/lib/core/sync/index.d.ts:53 |
filter? | (doc) => boolean | An extra predicate, ANDed with the filters above. Return true to replicate the document. Must be pure - PouchDB calls it once per change. Prefer classes where it fits: a bare function has no configuration DocStack can see, so its identity for checkpointing purposes is its own source text. Two closures over different data with the same source read as the same filter, and replication resumes where the other one left off. Build a fresh function whose source differs, or use classes. | client/lib/core/sync/index.d.ts:86 |
heartbeat? | number | false | Changes-feed heartbeat, in milliseconds, or false to disable. | client/lib/core/sync/index.d.ts:63 |
internalDocs? | false | InternalDocFilterOptions | Which of DocStack's own documents to keep on this device, or false to replicate everything including ~system. false is for stack-to-stack mirroring of a whole database and is otherwise a bad idea. Defaults to InternalDocFilterOptions' own defaults. | client/lib/core/sync/index.d.ts:93 |
live? | boolean | Keep replicating as changes happen. Defaults to true. | client/lib/core/sync/index.d.ts:55 |
remote | RemoteResolver | The remote to replicate against. See RemoteResolver. | client/lib/core/sync/index.d.ts:51 |
retry? | boolean | Retry on transient failure with PouchDB's backoff. Defaults to true. | client/lib/core/sync/index.d.ts:57 |
timeout? | number | false | Changes-feed timeout, in milliseconds, or false to disable. | client/lib/core/sync/index.d.ts:65 |