# Update

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.MongoDB>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                            | Description                                                                                                                                                                                                                                                                                                                    |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| UpdateOptions : `UpdateOptions` | <p>Update single or multiple documents.</p><p>Possible values:</p><ul><li><code>UpdateOne</code>:</li></ul><p>Update single or multiple documents.</p><ul><li><code>UpdateMany</code>:</li></ul><p>Update single or multiple documents.</p><p><br>Default: <code>0</code><br>Example: <code>UpdateOptions.UpdateOne</code></p> |
| UpdateString : `String`         | <p>The value(s) to be updated to document(s).</p><p><br>Default: <code>-</code><br>Example: <code>"{ $set: { 'foo': 'updated'} }"</code></p>                                                                                                                                                                                   |
| InputType : `InputType`         | <p>Input type.</p><p>Possible values:</p><ul><li><code>Filter</code>:</li></ul><p>Input type.</p><ul><li><code>Filters</code>:</li></ul><p>Input type.</p><ul><li><code>File</code>:</li></ul><p>Input type.</p><p><br>Default: <code>0</code><br>Example: <code>InputType.Filter</code></p>                                   |
| Filter : `String`               | <p>A single filter to be processed.</p><p><br>Default: <code>-</code><br>Example: <code>{'foo':'bar'}</code></p>                                                                                                                                                                                                               |
| Filters : `DocumentValues[]`    | <p>An array of filter(s) to be processed one by one.</p><p><br>Default: <code>-</code><br>Example: <code>{{'foo':'bar'}, {'bar':'foo'}}</code></p>                                                                                                                                                                             |
| File : `String`                 | <p>The file containing filter.</p><p><br>Default: <code>-</code><br>Example: <code>c:\temp\file.json</code></p>                                                                                                                                                                                                                |
| {% endtab %}                    |                                                                                                                                                                                                                                                                                                                                |

{% tab title="Parameter: Connection" %}

| Name                          | Description                                                                                                                               |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| 🗝ConnectionString : `String` | <p>Connection string.</p><p><br>Default: <code>-</code><br>Example: <code>mongodb://foo:bar\@localhost:00000/?authSource=admin</code></p> |
| Database : `String`           | <p>Database.</p><p><br>Default: <code>-</code><br>Example: <code>foo</code></p>                                                           |
| CollectionName : `String`     | <p>Collection name.</p><p><br>Default: <code>-</code><br>Example: <code>bar</code></p>                                                    |
| {% endtab %}                  |                                                                                                                                           |

{% tab title="Result: Result" %}

| Name                | Description                                                   |
| ------------------- | ------------------------------------------------------------- |
| Success : `Boolean` | <p>Update complete.<br>Example: <code>true</code></p>         |
| Count : `Int64`     | <p>Count of updated documents.<br>Example: <code>1</code></p> |
| {% endtab %}        |                                                               |

{% tab title="Changelog" %}

## Changelog

### \[1.0.1] - 2023-11-23

#### Fixed

* Fixed dll error when importing the Task to Frends by adding local dll reference to the project file.

### \[1.0.0] - 2022-11-01

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
