Repository navigation
feat(db-mongodb): upgrade to mongoose 9 - #17747
Merged
Merged
Conversation
Bumps mongoose to 9.9.2 and the mongodb driver to 7.5.0 to match. Adapts to the v9 breaking changes: - FilterQuery renamed to QueryFilter - numbers are no longer valid ObjectIDs, so only cast string customIDs - Model.create() no longer takes a third argument (the req passed when creating versions was already dead in v8) - lean findOne() ignores the ResultDoc generic, so cast the result instead - drop a stale ts-expect-error and a no-op timestamps option on a driver collection bulkWrite in the v2 -> v3 relationships migration
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
jmikrut
added a commit
that referenced
this pull request
Aug 14, 2026
Resolved one conflict in `updateByID`, taking main's base access control (#17662) which passes the entity slug into every access check. Three things the merge broke silently and needed fixing: - the merge preflight called access functions without `slug`, now required - `updateGlobal`'s branch-copy write passed a third argument to `Model.create`, which selects a different overload under Mongoose 9 (#17747) - `payload` and `translations` dist were stale, so `ui` could not see main's new clipboard keys or the `slug` access argument Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
jmikrut
added a commit
that referenced
this pull request
Aug 14, 2026
…ment` Mongoose 9 (#17747) deprecated the `new` option for `findOneAndUpdate` and `findOneAndReplace`, and logs a warning when it is used. The Next dev server forwards server logs to the browser console, and the e2e harness fails any test that produces a console error — so every e2e test that saved a document failed, 34 of 37 in the branching suite. Not branching-specific: `updateOne` is the generic document save. Any suite that updates a document through the admin panel hits it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
r1tsuu
added a commit
that referenced
this pull request
Sep 25, 2026
…imizer (#18313) `pnpm dev:tanstack` in the monorepo crashes on boot with `[MISSING_EXPORT] "fromTokenFile" is not exported by ".../@aws-sdk/credential-provider-web-identity/dist-es/index.js"`. Vite's client dep scan follows `import('@payload-config')` in server functions, reaches the database adapter, and pre-bundles the driver for the browser. Mongoose 9 (#17747) has no browser build, so this now pulls in `mongodb` and its optional `@aws-sdk/credential-providers` peer, whose browser build doesn't export `fromTokenFile`. Published installs don't crash, but they still bundle `@payloadcms/db-mongodb` into a browser chunk nothing loads. This excludes the `@payloadcms/db-*` adapters, `@payloadcms/drizzle`, `mongoose` and `mongodb` from the client optimizer, like the existing `@azure/storage-blob` exclusion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps mongoose to 9.9.2 and the mongodb driver to 7.5.0 to match.
Discussion #17729
Adapts to the v9 breaking changes: