> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/api-reference/database/collections/update-many.md).

# Update Many

Database.

**Collections** hold your records. Norbix generates a full CRUD + query API over each collection from its schema, with record-level ownership and triggers.

This endpoint updates the many — only the fields you send are changed.

{% openapi src="/files/LFXChrE9wGFKCxqoL5A1" path="/{version}/database/collections/{collectionName}/many" method="put" %}
[norbix-api-swagger.json](https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-b1d87ac242f296adb274a3238bdeaff152c54b4a%2Fnorbix-api-swagger.json?alt=media)
{% endopenapi %}

## Validation

The update is checked against the collection's **published schema**, like an insert: send the bare fields to change (e.g. `{"status": "shipped"}` — the server applies them with `$set`), and a value the schema forbids is refused.

## Empty filter

An empty filter `{}` (or no filter) is refused with `CM-ERRORS-DATABASE-037` so that a missing filter cannot touch the whole collection. To update every record on purpose, send `allRecords: true` together with the empty filter. Soft-deleted records are skipped. A caller with only own-record rights (`updateOwn`) may call it too — the filter is narrowed to records the caller owns.

An update body with MongoDB operators at the top level (`$inc`, `$set`, `$unset`, …) is refused with `CM-ERRORS-DATABASE-035`. An own-scope caller cannot change the owner here.

### Refused operators in the filter

A filter (or pipeline) that contains `$where`, `$function` or `$accumulator` — the MongoDB operators that run JavaScript on the database server — is refused with `CM-ERRORS-DATABASE-031` (*Operator '…' is not allowed in a record filter or read-only aggregation pipeline.*), one error per operator, at any depth. Use ordinary query operators instead.

## In Cloud

Manage this visually in Cloud — see [Database](/codemash/cloud/database/collections.md).

## Use it from code

Every Norbix SDK exposes this endpoint as a method — see [Update Many](/codemash/sdks/database/collections/update-many.md) in the SDK reference, with examples in every language.
