# Update One Document **POST /action/updateOne** Update a single document in a collection. ## Servers - Global App: https://data.mongodb-api.com/app/your-app-id/endpoint/data/v1 (Global App) - Local App: https://us-east-1.aws.data.mongodb-api.com/app/your-app-id/endpoint/data/v1 (Local App) ## Authentication methods - Access token - Email & Password - Api key - Custom jwt ## Parameters ## Body parameters Content-type: application/json - **dataSource** (string) The name of a linked MongoDB Atlas data source. This is commonly `"mongodb-atlas"` though it may be different in your App if you chose a different name when you created the data source. - **database** (string) The name of a database in the specified data source. - **collection** (string) The name of a collection in the specified database. - **filter** (object) A MongoDB query filter that matches documents. For a list of all query operators that the Data API supports, see [Query Operators](https://www.mongodb.com/ja-jp/docs/atlas/app-services/mongodb/crud-and-aggregation-apis/#query-operators). - **update** (object) A MongoDB update expression to apply to matching documents. For a list of all update operators that the Data API supports, see [Update Operators](https://www.mongodb.com/ja-jp/docs/atlas/app-services/mongodb/crud-and-aggregation-apis/#update-operators). - **upsert** (boolean) When `true`, if the update filter does not match any existing documents, then insert a new document based on the filter and the specified update operation. ## Responses ### 200: Updated #### Body Parameters: application/json (object) - **matchedCount** () The number of documents matched by the query filter. - **modifiedCount** () The number of matched documents that were modified. - **upsertedId** (string) The `_id` value of the upserted document. ### 400: The request was malformed or incomplete. #### Body Parameters: application/json (object) - **error** (string) A message that describes the error. - **error_code** (string) The error type. - **link** (string) A link to a [log entry](https://www.mongodb.com/ja-jp/docs/atlas/app-services/logs/endpoint/) for the failed operation. ### 401: The authenticated user does not have permission to access this endpoint. #### Body Parameters: application/json (object) - **error** (string) A message that describes the error. - **error_code** (string) The error type. - **link** (string) A link to a [log entry](https://www.mongodb.com/ja-jp/docs/atlas/app-services/logs/endpoint/) for the failed operation. [Powered by Bump.sh](https://bump.sh)