Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
feat(plugin-import-export): adds new exportLimit, importLimit and per collection limit control (#15405)
This PR adds `exportLimit`, `importLimit` and per collection `limit`
control and fixes a few reported bugs around preview behaviour and data
exports to CSV and expands the test coverage to all fields except
uploads as those will be expanded upon in another PR. Some of these bugs
are reported directly, not on Github.
## New limits control
Adds new exportLimit, importLimit and per collection limit control so
you can force a limit per user if necessary for how many documents can
be exported or imported in a single operation. This allows you to
prevent certain users from causing excessive server/resource usage.
The config can be added top level to affect all operations or you can
override on a per collection and per operation level, defaults to 0
(unlimited).
```ts
importExportPlugin({
exportLimit: ({ req }) => 500, // function with req
importLimit: 100, // hardcoded number
collections: [
{
slug: 'posts',
// per collection per operation overrides
export: {
limit: ({ req }) => 5,
},
import: {
limit: 5,
},
},
],
}),
```
Bugs fixed:
- Timezones being wrongly exported without being selected (but date is
selected)
- Timezones being duplicated when selected
- `disableSave` and `format` having no effect on the collection's export
configuration
Chores:
- Removed an internal utility in favour of a `payload/shared` one
- Added new e2e tests for `format`
- Int tests for `point`, `checkbox`, `select`, `radio`, `email`,
`textarea` and `code` P
Paul committed
a7beeca52316922007613fb8ec7f572f120ba157
Parent: 6158489
Committed by GitHub <noreply@github.com>
on 2/5/2026, 8:48:32 PM