Interface UpdateDescription<TSchema>

interface UpdateDescription<TSchema> {
    disambiguatedPaths?: Document;
    removedFields?: string[];
    truncatedArrays?: {
        field: string;
        newSize: number;
    }[];
    updatedFields?: Partial<TSchema>;
}

Type Parameters

Properties

disambiguatedPaths?: Document

A document containing additional information about any ambiguous update paths from the update event. The document maps the full ambiguous update path to an array containing the actual resolved components of the path. For example, given a document shaped like { a: { '0': 0 } }, and an update of { $inc: 'a.0' }, disambiguated paths would look like the following:

  {
'a.0': ['a', '0']
}

This field is only present when there are ambiguous paths that are updated as a part of the update event and showExpandedEvents is enabled for the change stream.

6.1.0

removedFields?: string[]

An array of field names that were removed from the document.

truncatedArrays?: {
    field: string;
    newSize: number;
}[]

An array of documents which record array truncations performed with pipeline-based updates using one or more of the following stages:

  • $addFields
  • $set
  • $replaceRoot
  • $replaceWith

Type declaration

  • field: string

    The name of the truncated field.

  • newSize: number

    The number of elements in the truncated array.

updatedFields?: Partial<TSchema>

A document containing key:value pairs of names of the fields that were changed, and the new value for those fields.