Update One Document

Update a single document in a collection.

post/action/updateOne

Request body

dataSourcestring required

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.

databasestring required

The name of a database in the specified data source.

collectionstring required

The name of a collection in the specified database.

filterobject required

A MongoDB query filter that matches documents. For a list of all query operators that the Data API supports, see Query Operators.

updateobject required

A MongoDB update expression to apply to matching documents. For a list of all update operators that the Data API supports, see Update Operators.

upsertboolean

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.

Changes