--- title: "system.mongodb.updateMany" description: "Updates all documents in the collection that match the filter." --- # system.mongodb.updateMany > Updates all documents in the collection that match the filter. This function is used in **Python Scripting**. :::note Project Library scripts will not provide hints for MongoDB system functions unless the Script Hint Scope is set to **Gateway**. See the [Scripting in Ignition](platform\scripting\scripting-in-ignition\scripting-in-ignition.md#system-functions-hints-and-autocomplete) page for more details on scripting hints. ::: ## Description ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.mongodb.updateMany(connector, collection, filter, updates, [options])` ### Parameters Type | Parameter | Description ------- | ------- | ------ String| `connector` | The name of connector (case-insensitive). String| `collection` | The name of collection (case-sensitive). PyDictionary| `filter` | A PyDictionary for specifying matching key value pair criteria when querying a collection. PyDictionary | List[PyDictionary]| `updates` | Changes to apply to specific document fields. Also supports aggregation pipeline for update operations. [See MongoDB documentation](https://www.mongodb.com/docs/v6.0/reference/operator/update/) for all valid update operators. PyDictionary| `options` | A PyDictionary for including additional update configurations. [optional]. ### Returns **PyDictionary** `result` - Result of update action formatted as a PyDictionary with keys ‘acknowledged’, ‘modifiedCount’, ‘matchedCount’, and ‘upsertedId’. ### Scope Gateway, Perspective Session ## Importing Classes You can import classes from system.mongodb.types like you would other Python classes: #### Example ``` from system.mongodb.types import ObjectId newObjectId = ObjectId.get() ``` You can also iterate those system.mongodb.types packages to see all available classes: #### Example ``` for d in dir(system.mongodb.types): print d ``` ### API Docs MongoDB-specific data types come from the org.bson.types package of the Mongo Java Driver API. The library of classes available for import can be accessed at this link: [Mongo Java Driver 3.6.0 API Docs for Package org.bson.types](https://mongodb.github.io/mongo-java-driver/3.6/javadoc/org/bson/types/package-summary.html). ## Types References The following values can be referenced for the types parameter at system.mongodb.types: ``` Binary Code CodeWScope CodeWithScope Decimal128 INSTANCE MaxKey MinKey ObjectId Symbol Timestamp ``` ## Code Examples ```python title="Example #1" # Specify unique field values to locate specific document. Here we are locating documents with the field 'limit' equal to 9000. filter = {"limit": 9000} # Specify document fields to update for found BSON document(s). 'limits' is an existing field on the document. updates = [ {"$set": { "limit": 10000 } } ] # Apply parameters for function call. print system.mongodb.updateMany("MongoDB", "accounts", filter, updates) ```