Interface: DocStackSyncOptions
Defined in: packages/client/src/core/sync/index.ts:718
Options for DocStack.sync, which starts one handle per stack.
Extends
Omit<StackSyncOptions,"remote">
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
batchesLimit? | number | Concurrent batches. Passed to PouchDB as batches_limit. | StackSyncOptions.batchesLimit | packages/client/src/core/sync/index.ts:74 |
batchSize? | number | Documents per batch. Passed to PouchDB as batch_size. | StackSyncOptions.batchSize | packages/client/src/core/sync/index.ts:72 |
checkSchemaVersion? | boolean | Refuse to start when the remote was last written by a newer schema. Defaults to true. See SyncSchemaMismatchError. | StackSyncOptions.checkSchemaVersion | packages/client/src/core/sync/index.ts:111 |
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"] } }); | StackSyncOptions.classes | packages/client/src/core/sync/index.ts:88 |
direction? | SyncDirection | Direction of travel. Defaults to "both". | StackSyncOptions.direction | packages/client/src/core/sync/index.ts:66 |
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. | StackSyncOptions.filter | packages/client/src/core/sync/index.ts:99 |
heartbeat? | number | false | Changes-feed heartbeat, in milliseconds, or false to disable. | StackSyncOptions.heartbeat | packages/client/src/core/sync/index.ts:76 |
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. | StackSyncOptions.internalDocs | packages/client/src/core/sync/index.ts:106 |
live? | boolean | Keep replicating as changes happen. Defaults to true. | StackSyncOptions.live | packages/client/src/core/sync/index.ts:68 |
remote | RemoteResolver | The remote for a given stack. Called once per stack, so an application with a database per workspace answers with a folder per workspace. | - | packages/client/src/core/sync/index.ts:723 |
retry? | boolean | Retry on transient failure with PouchDB's backoff. Defaults to true. | StackSyncOptions.retry | packages/client/src/core/sync/index.ts:70 |
stacks? | string[] | Which stacks to sync. Defaults to all of them. | - | packages/client/src/core/sync/index.ts:727 |
tenants? | string[] | The tenant entitlement this replication serves, compiled into per-stack configuration by deriveTenantScope: stacks outside the scope are not synced at all - withheld structurally, not filtered - and stacks holding a mix of declarations get a class filter. Combines with stacks (which pre-narrows the candidates) but not with classes, whose slot the compiled rules occupy; narrow further with filter. See ADR-0030. | - | packages/client/src/core/sync/index.ts:736 |
timeout? | number | false | Changes-feed timeout, in milliseconds, or false to disable. | StackSyncOptions.timeout | packages/client/src/core/sync/index.ts:78 |