This adds support for `sort` in `payload.db.updateMany`.
## Example
```ts
const updatedDocs = await payload.db.updateMany({
collection: 'posts',
data: {
title: 'updated',
},
limit: 5,
sort: '-numberField', // <= new
where: {
id: {
exists: true,
},
},
})
```
Payload MongoDB Adapter
Official MongoDB adapter for Payload.
Installation
npm install @payloadcms/db-mongodb
Usage
import { buildConfig } from 'payload'
import { mongooseAdapter } from '@payloadcms/db-mongodb'
export default buildConfig({
db: mongooseAdapter({
url: process.env.DATABASE_URI,
}),
// ...rest of config
})
More detailed usage can be found in the Payload Docs.