Interface ListenOptions

Options for listening to real-time updates. Used with client.listen() to subscribe to document changes.

interface ListenOptions {
    effectFormat?: "mendoza";
    events?: ListenEventName[];
    includeAllVersions?: boolean;
    includeMutations?: boolean;
    includePreviousRevision?: boolean;
    includeResult?: boolean;
    tag?: string;
    visibility?: "query" | "transaction";
}

Properties

effectFormat?: "mendoza"

Format for mutation effects. 'mendoza' includes apply and revert arrays.

events?: ListenEventName[]

Event types to include in the observable.

['mutation']
includeAllVersions?: boolean
includeMutations?: boolean

Whether to include the mutations that were performed. Set to false to reduce bandwidth if you only need the final document.

true
includePreviousRevision?: boolean

Whether to include the document state before the mutation. Useful for tracking what changed.

false
includeResult?: boolean

Whether to include the resulting document in addition to mutations. Set to false to reduce bandwidth if you only need mutation info.

true
tag?: string

Optional tag to identify the listener in logs

visibility?: "query" | "transaction"

When to send events:

  • 'transaction': As soon as transaction is committed (default)
  • 'query': Only after changes are visible to queries
'transaction'