Skip to main content

Interface: ClassFilterOptions

Defined in: packages/client/src/core/sync/class-filter.ts:59

Which classes replicate.

include and exclude may be combined; exclude wins where they overlap. Entries are matched against a document's ~class and against a relation's sourceClass/targetClass, which hold class ids - the same string for any class created through Class.create, where the id is the name.

Example

// Everything except one class.
{ exclude: ["Draft"] }

// Only these classes, plus the data model that makes them readable.
{ include: ["Task", "Project"] }

Properties

PropertyTypeDescriptionDefined in
exclude?string[]Never replicate these classes. Applied after include. This drops documents of those classes. The class models themselves still replicate, so the remote stays a readable replica - a class model is ~class: "class", not ~class: "<the class>". To keep a class model on the device too, add its id to internalDocs.extraDocIds; a class created through Class.create has its name as its id.packages/client/src/core/sync/class-filter.ts:71
include?string[]Replicate only these classes. Omit to replicate all but exclude.packages/client/src/core/sync/class-filter.ts:61
includeDataModel?booleanKeep DATA_MODEL_CLASSES when include is set. Defaults to true; turn it off only when the remote is not meant to be a readable replica.packages/client/src/core/sync/class-filter.ts:76