API 参考
    正在准备搜索索引...

    接口 UpdateDescription<TSchema>

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

    类型参数

    索引

    属性

    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

    类型声明

    • 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.