Standalone reproduction with stock Payload 3.91.0, its MongoDB adapter 3.91.0, and Mongoose 8.24.1. No application plugins or Next.js server are needed.
Use Node.js 26 and an existing local MongoDB replica set. The tested server is MongoDB 8.0.28. Save all three files in one directory, then run:
npm install
MONGODB_URI='mongodb://127.0.0.1:27017/?replicaSet=rs0&directConnection=true' npm run reproduceAdjust the connection URI for your local development replica set. Do not use a
production database. Each execution explicitly selects a fresh
payload_global_index_repro_<UUID> database; it does not read or drop any
existing application database. It leaves its synthetic database for inspection.
The script configures two globals with different slugs and versions.drafts.
It awaits every Mongoose model's normal initialization to expose the rejected
background index build. The index named _status_1 has different
partialFilterExpression.globalType values for the two discriminators, so the
second definition fails with MongoDB code 86 (IndexKeySpecsConflict). Which
global wins may vary.
The script exits successfully when that expected failure is reproduced. It also writes and rereads both globals to distinguish incomplete indexing from content loss or an unconditional startup failure. After an upstream fix, the version-sensitive conflict assertion should fail and be replaced with assertions that all intended indexes exist.