Update Many

Updates many documents

Use mass update to update many records from the database with one API call.

[UpdateMany] - Updates many documents

patch

Use mass update to update many records from the database with one API call. https://docs.codemash.io/api/database/collections/update-many

Authorizations
Path parameters
CollectionNameanyrequired

Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".

versionanyrequired

The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2

Header parameters
Acceptanyrequired

Accept Header

X-CM-Clusteranyoptional

API key of your cluster. Can be passed in a header as X-CM-Cluster.

X-CM-ProjectIdanyrequired

ID of your project. Can be passed in a header as X-CM-ProjectId.

CultureCodeanyoptional

Specify culture code when your response from the API should be localised. E.g.: en

Body
anyoptional
Responses
curl -L \
  --request PATCH \
  --url 'https://api.codemash.io//{version}/db/{CollectionName}/bulk' \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json'
{
  "response_status": {
    "error_code": "text",
    "message": "text",
    "stack_trace": "text",
    "errors": [
      {
        "error_code": "text",
        "field_name": "text",
        "message": "text",
        "meta": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        }
      }
    ],
    "meta": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    }
  },
  "result": {
    "is_acknowledged": true,
    "matched_count": 1,
    "modified_count": 1,
    "upserted_id": "text"
  }
}

Last updated

Was this helpful?