Skip to main content

Interface: DocStackSyncOptions

Defined in: client/lib/core/sync/index.d.ts:304

Options for DocStack.sync, which starts one handle per stack.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
batchesLimit?numberConcurrent batches. Passed to PouchDB as batches_limit.StackSyncOptions.batchesLimitclient/lib/core/sync/index.d.ts:61
batchSize?numberDocuments per batch. Passed to PouchDB as batch_size.StackSyncOptions.batchSizeclient/lib/core/sync/index.d.ts:59
checkSchemaVersion?booleanRefuse to start when the remote was last written by a newer schema. Defaults to true. See SyncSchemaMismatchError.StackSyncOptions.checkSchemaVersionclient/lib/core/sync/index.d.ts:98
classes?ClassFilterOptionsWhich 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.classesclient/lib/core/sync/index.d.ts:75
direction?SyncDirectionDirection of travel. Defaults to "both".StackSyncOptions.directionclient/lib/core/sync/index.d.ts:53
filter?(doc) => booleanAn 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.filterclient/lib/core/sync/index.d.ts:86
heartbeat?number | falseChanges-feed heartbeat, in milliseconds, or false to disable.StackSyncOptions.heartbeatclient/lib/core/sync/index.d.ts:63
internalDocs?false | InternalDocFilterOptionsWhich 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.internalDocsclient/lib/core/sync/index.d.ts:93
live?booleanKeep replicating as changes happen. Defaults to true.StackSyncOptions.liveclient/lib/core/sync/index.d.ts:55
remoteRemoteResolverThe remote for a given stack. Called once per stack, so an application with a database per workspace answers with a folder per workspace.-client/lib/core/sync/index.d.ts:309
retry?booleanRetry on transient failure with PouchDB's backoff. Defaults to true.StackSyncOptions.retryclient/lib/core/sync/index.d.ts:57
stacks?string[]Which stacks to sync. Defaults to all of them.-client/lib/core/sync/index.d.ts:313
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.-client/lib/core/sync/index.d.ts:322
timeout?number | falseChanges-feed timeout, in milliseconds, or false to disable.StackSyncOptions.timeoutclient/lib/core/sync/index.d.ts:65