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.

      Parameters

      • documents: AnyObject[]

        The array of documents to update.

      • condition: AnyObject

        The selection criteria for the update.

      • modifier: Modifier | PipelineStage[]

        The modifications to apply.

      • updateConfig: UpdateConfig = {}

        Optional update config parameters.

      • Optionaloptions: Partial<Options>

        Optional settings to control update behavior.

      Returns UpdateResult