### What? This PR removes a pair unnecessary calls to `schema.index` against the timestamp fields. The issue is when a user sets `indexSortableFields` as this is what will ultimately pass the predicate which then creates duplicate indexes. ### Why? These calls are redundant as `index` is [already passed](https://github.com/payloadcms/payload/blob/main/packages/db-mongodb/src/models/buildSchema.ts#L69) to the underlying fields base schema options in the process of formatting and will already be indexed. These warnings were surfaced after the bump to mongoose to version 8.9.5 as [in 8.9.3 mongoose began throwing these warnings to indicate duplicative indexes](https://github.com/Automattic/mongoose/releases/tag/8.9.3). ### How? By removing these calls and, as a result, silencing the warnings thrown by mongoose.
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.