mingo
    Preparing search index...

    Function updateOne

    • Updates a single document within the collection based on the filter.

      Supports both aggregation pipeline updates and standard update operators. Returns the number of documents matched and modified. Objects in the array may be modified inplace or replaced entirely.

      Type Parameters

      Parameters

      • documents: T[]

        The array of documents to update.

      • condition: Criteria<T>

        The selection criteria for the update.

      • modifier: Modifier<T> | PipelineStage[]

        The modifications to apply.

      • updateConfig: UpdateConfig = {}

        Optional update config parameters.

      • Optionaloptions: Partial<Options>

        Optional settings to control update behavior.

      Returns UpdateResult