feat: adds option to mongoose to ensure indexes (#9155)

Adds option `ensureIndexes` to Mongoose adapter, which will ensure
indexes are ready prior to completing connection.
This commit is contained in:
James Mikrut
2024-11-12 14:42:25 -05:00
committed by GitHub
parent a3ebf51d6e
commit 6bb4067bb3
3 changed files with 26 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ export const allDatabaseAdapters = {
import { mongooseAdapter } from '@payloadcms/db-mongodb'
export const databaseAdapter = mongooseAdapter({
ensureIndexes: true,
url:
process.env.MONGODB_MEMORY_SERVER_URI ||
process.env.DATABASE_URI ||