Skip to content
Open

9.0 #15728

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
9c082be
add test case for #15317 covering doc updateOne server errors
vkarpov15 Apr 27, 2025
4b2e830
refactor: clean up createSaveOptions logic to simplify $__handleSave
vkarpov15 Apr 27, 2025
68641b6
refactor: remove $__handleSave(), move logic into $__save()
vkarpov15 Apr 27, 2025
3fc683a
refactor: simplify optimistic concurrency handling to rely on $__delt…
vkarpov15 Apr 27, 2025
b19ed8f
fix: better handling for deleteOne hooks on deleted subdocs
vkarpov15 Apr 27, 2025
bd5fd4d
add note about deleteOne hooks to migrating_to_9
vkarpov15 Apr 27, 2025
91791a0
refactor: make insertMany use async functions for async stack traces …
vkarpov15 Apr 27, 2025
57c60e1
style: fix lint
vkarpov15 Apr 27, 2025
a1733f8
Update lib/browserDocument.js
vkarpov15 Apr 28, 2025
48b2c51
Update lib/document.js
vkarpov15 Apr 28, 2025
c3a97af
Update lib/model.js
vkarpov15 Apr 28, 2025
2760600
Merge pull request #15375 from Automattic/vkarpov15/async-post-save
vkarpov15 Apr 28, 2025
754a825
BREAKING CHANGE: enforce consistent async for custom methods with hoo…
vkarpov15 Apr 28, 2025
26c6f1d
async stack traces for hooks for custom statics and methods re: #15317
vkarpov15 Apr 28, 2025
0b79373
BREAKING CHANGE: require Node 18
vkarpov15 Apr 28, 2025
e32a1bd
add note re: mongoosejs/kareem#39
vkarpov15 Apr 28, 2025
2d6c573
Merge branch 'master' into 9.0
vkarpov15 Apr 28, 2025
1d0beb6
Update docs/migrating_to_9.md
vkarpov15 Apr 28, 2025
afbb798
Merge branch '9.0' into vkarpov15/async-custom-hooks-statics
vkarpov15 Apr 28, 2025
321283b
Merge branch 'vkarpov15/async-custom-hooks-statics' of github.com:Aut…
vkarpov15 Apr 28, 2025
5389610
docs: add note about version support to changelog
vkarpov15 Apr 28, 2025
fb98348
style: fix lint
vkarpov15 Apr 28, 2025
98b4f0f
Merge pull request #15376 from Automattic/vkarpov15/async-custom-hook…
vkarpov15 Apr 28, 2025
ae143f4
BREAKING CHANGE: make UUID schema type return bson UUIDs
vkarpov15 Apr 28, 2025
f26d218
types: convert UUID to string for JSON serialization
vkarpov15 Apr 28, 2025
12b96e7
style: fix lint
vkarpov15 Apr 28, 2025
9b9ba10
deps(kareem): change dependency notation to be HTTPS and properly "git"
hasezoey Apr 29, 2025
72aadaf
Update types/index.d.ts
vkarpov15 Apr 29, 2025
2bf2105
Merge pull request #15378 from Automattic/vkarpov15/gh-15330
vkarpov15 Apr 29, 2025
03cc91f
fix: remove unnecessary workaround for #15315 now that #15378 is fixed
vkarpov15 Apr 29, 2025
1e8aee5
fix(SchemaType): add missing continue
vkarpov15 Apr 29, 2025
4748307
Merge pull request #15381 from hasezoey/fixKareem
vkarpov15 Apr 29, 2025
f55d676
BREAKING CHANGE: remove browser build, move to @mongoosejs/browser in…
vkarpov15 Apr 29, 2025
8f4ec14
remove node: from async_hooks import for @mongoosejs/browser webpack
vkarpov15 Apr 29, 2025
0ab148b
style: fix lint
vkarpov15 Apr 29, 2025
42ed27e
Update test/docs/lean.test.js
vkarpov15 Apr 29, 2025
3ceae09
Merge pull request #15384 from Automattic/vkarpov15/gh-15380
vkarpov15 Apr 30, 2025
b542461
Merge branch 'master' into 9.0
vkarpov15 Apr 30, 2025
6e50346
Merge branch 'master' into 9.0
vkarpov15 May 2, 2025
46746b8
Merge branch '9.0' into vkarpov15/gh-15296
vkarpov15 May 5, 2025
e8fa83f
Merge branch 'vkarpov15/gh-15296' of github.com:Automattic/mongoose i…
vkarpov15 May 5, 2025
a8363e5
fix lint
vkarpov15 May 5, 2025
aa23bad
docs: link browser docs out to @mongoosejs/browser readme
vkarpov15 May 5, 2025
c28738e
Merge pull request #15385 from Automattic/vkarpov15/gh-15296
vkarpov15 May 5, 2025
6dd7f6e
Merge branch 'master' into 9.0
vkarpov15 May 5, 2025
dc6071d
chore(dev-deps): update "@typescript-eslint/*" to 8.31.1
hasezoey Apr 30, 2025
3617299
chore(dev-deps): update "eslint" to 9.25.1
hasezoey Apr 30, 2025
9dc238b
chore: migrate to eslint flat configs
hasezoey Apr 30, 2025
7adfc99
chore(dev-deps): change acquit to use espree PR
hasezoey May 6, 2025
80f2c5e
docs(browser): fix typo
hasezoey May 6, 2025
0b45667
use new version of acquit
vkarpov15 May 6, 2025
7e3ad04
Merge pull request #15387 from hasezoey/eslint9
vkarpov15 May 6, 2025
c66b840
BREAKING CHANGE: make FilterQuery properties no longer resolve to `an…
vkarpov15 May 13, 2025
e109cab
test: add some docs
vkarpov15 May 13, 2025
45812b6
Merge branch 'master' into 9.0
vkarpov15 May 13, 2025
a1b0cc0
Merge branch '9.0' into vkarpov15/gh-14506
vkarpov15 May 13, 2025
e946ff0
docs: add note about FilterQuery changes to migrating_to_9
vkarpov15 May 13, 2025
f6260d5
style: fix lint
vkarpov15 May 13, 2025
a10dd67
Merge pull request #15422 from Automattic/vkarpov15/gh-14506
vkarpov15 May 14, 2025
70ddfd8
clean up merge conflicts
vkarpov15 May 19, 2025
6ec3b48
Merge branch 'master' into 9.0
vkarpov15 May 26, 2025
848478a
refactor: remove unnecessary async iterator checks
vkarpov15 May 26, 2025
56137d4
style: fix lint
vkarpov15 May 26, 2025
6e40cb7
Merge pull request #15435 from Automattic/vkarpov15/remove-async-iter…
vkarpov15 May 28, 2025
9eeabed
Merge branch 'master' into 9.0
vkarpov15 Jun 12, 2025
b56dfa0
Merge branch 'master' into 9.0
vkarpov15 Jun 15, 2025
4df6527
WIP adding Schema.create() for better TypeScript typings
vkarpov15 Jun 18, 2025
91d803d
WIP Schema.create() re: #14954
vkarpov15 Jun 18, 2025
b581bf8
fix remaining tests re: #14954
vkarpov15 Jun 19, 2025
509d0d1
Merge branch 'master' into 9.0
vkarpov15 Jun 19, 2025
f23215a
fix lint
vkarpov15 Jun 19, 2025
408de49
Merge branch 'master' into 9.0
vkarpov15 Jun 22, 2025
469a9f3
WIP replace caster with embeddedSchemaType and Constructor re: #15179
vkarpov15 Jun 23, 2025
761fd30
WIP remove some more .caster uses re: #15179
vkarpov15 Jun 23, 2025
638e2c4
WIP remove some more caster refs re: #15179
vkarpov15 Jun 23, 2025
1fdaee6
WIP remove some more caster usages for #15179
vkarpov15 Jun 23, 2025
45bf358
WIP remove some more caster usages for #15179
vkarpov15 Jun 24, 2025
321a5f9
WIP remove some more caster usages for #15179
vkarpov15 Jun 24, 2025
7f84bf6
WIP remove some more caster usages for #15179
vkarpov15 Jun 24, 2025
659b255
WIP remove some more caster usages for #15179
vkarpov15 Jun 24, 2025
8ac9f8f
Merge branch 'master' into 9.0
vkarpov15 Jul 2, 2025
b39aa48
Merge branch 'master' into vkarpov15/gh-15179
vkarpov15 Jul 2, 2025
452940b
fix merge issue
vkarpov15 Jul 2, 2025
4672b07
Merge branch '9.0' into vkarpov15/gh-15179
vkarpov15 Jul 2, 2025
f986aae
remove some more usage of .caster
vkarpov15 Jul 2, 2025
3b77da0
remove a few more .caster re: #15179
vkarpov15 Jul 2, 2025
74d5ad0
final removal of caster and casterConstructor
vkarpov15 Jul 3, 2025
19abcb6
docs: add #15179 to docs
vkarpov15 Jul 3, 2025
671f509
use tostring to fix encryption tests
vkarpov15 Jul 3, 2025
fac22ed
use uuid.equals()
vkarpov15 Jul 3, 2025
0d0d06a
BREAKING CHANGE: remove background option from indexes
vkarpov15 Jul 3, 2025
5734c00
update compatibility to show Mongoose 9 supporting MongoDB 6 or greater
vkarpov15 Jul 3, 2025
d8bc326
Merge branch 'master' into 9.0
vkarpov15 Jul 3, 2025
47cef1d
Merge branch '9.0' into vkarpov15/schema-create
vkarpov15 Jul 3, 2025
a5100ec
fix merge conflict
vkarpov15 Jul 3, 2025
bd8a7b0
Merge branch '9.0' into vkarpov15/schema-create
vkarpov15 Jul 3, 2025
024e5a7
fix tests
vkarpov15 Jul 3, 2025
b02e3e7
address comments
vkarpov15 Jul 3, 2025
f6a68a3
address comments
vkarpov15 Jul 3, 2025
f2ed2f0
types: correct inference for timestamps with methods
vkarpov15 Jul 3, 2025
d1fe7e1
Merge branch 'master' into 9.0
vkarpov15 Jul 4, 2025
ab9cbc6
Merge branch '9.0' into vkarpov15/schema-create
vkarpov15 Jul 4, 2025
fe97fbe
Update migrating_to_9.md
vkarpov15 Jul 5, 2025
3257570
Merge pull request #15514 from Automattic/vkarpov15/gh-15476
vkarpov15 Jul 5, 2025
aa18053
Update docs/migrating_to_9.md
vkarpov15 Jul 5, 2025
00426d4
Update docs/migrating_to_9.md
vkarpov15 Jul 5, 2025
52c7573
types: avoid FlattenMaps by default on toObject(), toJSON(), lean()
vkarpov15 Jul 5, 2025
da378db
types: add TTransformOptions for InferRawDocType so RawDocType and Le…
vkarpov15 Jul 6, 2025
cef5e5b
remove unused symbol
vkarpov15 Jul 7, 2025
5155c28
docs: add casterConstructor example
vkarpov15 Jul 7, 2025
c510811
docs: add note about $embeddedSchemaType -> embeddedSchemaType
vkarpov15 Jul 7, 2025
6657fa1
docs: remove unused comment
vkarpov15 Jul 7, 2025
b713fa8
docs: add JSDoc note about documentArrayElement params
vkarpov15 Jul 7, 2025
7367171
refactor: use variables to make code more readable
vkarpov15 Jul 7, 2025
a7c0c7d
Merge pull request #15513 from Automattic/vkarpov15/gh-15179
vkarpov15 Jul 7, 2025
618dabd
Merge branch 'master' into 9.0
vkarpov15 Jul 7, 2025
0a18377
Merge branch '9.0' into vkarpov15/schema-create
vkarpov15 Jul 7, 2025
ae2e9e7
types: add InferRawDocTypeFromSchema
vkarpov15 Jul 7, 2025
9340115
Merge branch 'vkarpov15/schema-create' into vkarpov15/gh-13523-3
vkarpov15 Jul 7, 2025
db76c64
fix tests
vkarpov15 Jul 7, 2025
5ea5354
Merge branch 'master' into 9.0
vkarpov15 Jul 7, 2025
c69ee03
Merge branch '9.0' into vkarpov15/schema-create
vkarpov15 Jul 7, 2025
da055be
fix lint
vkarpov15 Jul 7, 2025
357e0ee
Merge branch 'vkarpov15/schema-create' into vkarpov15/gh-13523-3
vkarpov15 Jul 7, 2025
4cd119f
merge fixes
vkarpov15 Jul 7, 2025
ee120cf
types: WIP inferHydratedDocTypeFromSchema
vkarpov15 Jul 7, 2025
9d721e2
types: complete testing inferHydratedDocTypeFromSchema with new Schem…
vkarpov15 Jul 8, 2025
2ae6ef9
Merge branch 'master' into 9.0
vkarpov15 Jul 11, 2025
0949ada
Merge branch '9.0' into vkarpov15/schema-create
vkarpov15 Jul 11, 2025
31299fc
Merge branch 'vkarpov15/schema-create' of github.com:Automattic/mongo…
vkarpov15 Jul 11, 2025
5d49e29
Merge branch 'vkarpov15/schema-create' into vkarpov15/gh-13523-3
vkarpov15 Jul 11, 2025
f21175f
merge conflict cleanup
vkarpov15 Jul 11, 2025
8e4b6a6
test: fix tests
vkarpov15 Jul 11, 2025
a089923
Merge branch 'master' into 9.0
vkarpov15 Jul 23, 2025
42a8689
Merge branch '9.0' into vkarpov15/schema-create
vkarpov15 Jul 23, 2025
d9834e9
BREAKING CHANGE: make `id` a virtual in TypeScript rather than a prop…
vkarpov15 Aug 6, 2025
bb450a5
Merge branch 'master' into 9.0
vkarpov15 Aug 8, 2025
f05e9ca
fix tests
vkarpov15 Aug 8, 2025
4b6e55d
fix tests
vkarpov15 Aug 8, 2025
6e4af36
Merge branch '9.0' into vkarpov15/gh-13079-2
vkarpov15 Aug 8, 2025
cf8dbc0
types: add DefaultIdVirtual and AddDefaultId types re #15572, #13079
vkarpov15 Aug 8, 2025
3ba44b1
docs: add note about id change
vkarpov15 Aug 8, 2025
aeceb7b
fix lint
vkarpov15 Aug 8, 2025
cbd6ed3
Merge pull request #15572 from Automattic/vkarpov15/gh-13079-2
vkarpov15 Aug 8, 2025
1556421
BREAKING CHANGE: remove bson as direct dependency, use mongodb/lib/bs…
vkarpov15 Aug 10, 2025
be26578
test: make test more resilient
vkarpov15 Aug 12, 2025
5da0a9c
Merge pull request #15576 from Automattic/vkarpov15/gh-15154
vkarpov15 Aug 12, 2025
6ad040a
BREAKING CHANGE: disallow update pipelines by default, require update…
vkarpov15 Aug 16, 2025
ffb1f41
docs(migrating_to_9): add note about updatePipeline change
vkarpov15 Aug 16, 2025
d11cf04
BREAKING CHANGE: make create() and insertOne() params more strict, re…
vkarpov15 Aug 16, 2025
06c8245
Merge pull request #15586 from Automattic/vkarpov15/gh-14424
vkarpov15 Aug 17, 2025
0bfb747
types: add numbers/strings for dates and arrays of arrays for maps to…
vkarpov15 Aug 17, 2025
2516a98
docs(migrating_to_9): quick note to provide context for code sample
vkarpov15 Aug 17, 2025
7c215bd
Merge branch 'master' into 9.0
vkarpov15 Aug 17, 2025
9c0b305
BREAKING CHANGE: rename FilterQuery -> QueryFilter, add 1-level deep …
vkarpov15 Aug 18, 2025
a20e0c2
BREAKING CHANGE: consolidate RootQuerySelector, Condition, etc. types…
vkarpov15 Aug 18, 2025
b880d61
Merge branch 'master' into 9.0
vkarpov15 Aug 22, 2025
71a69ad
remove examples directory
vkarpov15 Aug 22, 2025
10a6caa
Merge pull request #15597 from Automattic/vkarpov15/remove-example
vkarpov15 Aug 24, 2025
d24762d
BREAKING CHANGE: remove support for callbacks in pre middleware
vkarpov15 Aug 25, 2025
9f40ebf
types: avoid WithLevel1NestedPaths drilling into non-records re: #155…
vkarpov15 Aug 28, 2025
2a97abc
Merge pull request #15592 from Automattic/vkarpov15/gh-12064
vkarpov15 Sep 1, 2025
2b0bc62
Merge branch 'master' into 9.0
vkarpov15 Sep 4, 2025
f19a373
Merge branch 'master' into 9.0
vkarpov15 Sep 8, 2025
3b78dd8
Merge branch '9.0' into vkarpov15/consolidate-types
vkarpov15 Sep 8, 2025
02fe4e3
Merge branch '9.0' into vkarpov15/gh-15355-2
vkarpov15 Sep 8, 2025
4170755
fix query casting weirdnesses
vkarpov15 Sep 8, 2025
d29cd53
types: use deep partial for create type casting
vkarpov15 Sep 8, 2025
364e14b
remove use$geoWithin re: mongoosejs/mquery#141
vkarpov15 Sep 9, 2025
a3e4c88
Remove noListener option from useDb
vkarpov15 Sep 22, 2025
33a8067
Merge branch 'master' into 9.0
vkarpov15 Sep 22, 2025
cbb5d10
Merge branch 'master' into 9.0
vkarpov15 Sep 22, 2025
db84e49
Merge branch '9.0' into vkarpov15/gh-11531
vkarpov15 Sep 22, 2025
8f9f02b
fix lint
vkarpov15 Sep 22, 2025
f41de58
docs: update middleware.md for no more next() in pre hooks
vkarpov15 Sep 22, 2025
7b87977
Merge branch '9.0' into codex/remove-nolistener-option-from-code
vkarpov15 Sep 28, 2025
ac9c4b5
Merge pull request #15641 from vkarpov15/codex/remove-nolistener-opti…
vkarpov15 Sep 28, 2025
cce174c
docs(migrating_to_9): add note about removing noListener re: #15641
vkarpov15 Sep 28, 2025
5815535
Merge pull request #15599 from Automattic/vkarpov15/gh-11531
vkarpov15 Sep 28, 2025
339f031
Merge branch '9.0' into vkarpov15/consolidate-types
vkarpov15 Sep 28, 2025
e6a447a
type cleanup
vkarpov15 Sep 28, 2025
762446f
clean up types performance
vkarpov15 Sep 28, 2025
7bda5b0
more performant types
vkarpov15 Sep 28, 2025
d1ebd20
perf: remove some unnecessary typescript generics
vkarpov15 Sep 28, 2025
cee9a5a
bump max instantiations
vkarpov15 Sep 28, 2025
2d3db2c
Merge branch '9.0' into vkarpov15/gh-15355-2
vkarpov15 Sep 28, 2025
4936971
types: add HydratedDocFromModel to make it easier to get the doc type…
vkarpov15 Sep 28, 2025
b415176
Merge pull request #15587 from Automattic/vkarpov15/gh-15355-2
vkarpov15 Sep 29, 2025
55fa0fc
Merge pull request #15593 from Automattic/vkarpov15/consolidate-types
vkarpov15 Sep 30, 2025
bf52aa0
Merge branch 'master' into 9.0
vkarpov15 Sep 30, 2025
aff67b8
BREAKING CHANGE: remove skipId parameter to Document() and Model(), a…
vkarpov15 Sep 30, 2025
4d42ded
Update lib/document.js
vkarpov15 Oct 2, 2025
e5cff9a
docs: add skipId options docs re: code review comments
vkarpov15 Oct 2, 2025
c867a04
Merge pull request #15656 from Automattic/vkarpov15/gh-8862
vkarpov15 Oct 2, 2025
7990490
Merge branch 'master' into 9.0
vkarpov15 Oct 2, 2025
247e6ac
types: fix one more merge issue
vkarpov15 Oct 3, 2025
47bcd6a
merge conflict fixed
vkarpov15 Oct 3, 2025
f63f223
clean up most type issues from merge
vkarpov15 Oct 3, 2025
7eba5ff
fix last tests
vkarpov15 Oct 5, 2025
5dc43e0
types: remove a bunch of unnecessary function overrides and simplify …
vkarpov15 Oct 5, 2025
7c22a6e
Merge pull request #15482 from Automattic/vkarpov15/schema-create
vkarpov15 Oct 6, 2025
18fb823
Merge branch 'master' into 9.0
vkarpov15 Oct 6, 2025
b7a76d5
Merge branch '9.0' into vkarpov15/gh-13523-3
vkarpov15 Oct 13, 2025
c30375d
some merge conflict fixes
vkarpov15 Oct 13, 2025
3b9b6c8
fix THydratedDocumentType params
vkarpov15 Oct 13, 2025
64027dc
fix some missing overrides
vkarpov15 Oct 13, 2025
72eba8c
fix: clean up a couple of more merge conflict issues
vkarpov15 Oct 13, 2025
31778f1
couple of more fixes
vkarpov15 Oct 13, 2025
d565fb1
quick test fix
vkarpov15 Oct 13, 2025
0c7ce68
clean up a couple of more type issues
vkarpov15 Oct 13, 2025
b579111
fix enum handling in InferRawDocType
vkarpov15 Oct 13, 2025
47bb200
fix out of date test
vkarpov15 Oct 13, 2025
5671e58
fix up test inconsistency
vkarpov15 Oct 15, 2025
659c098
types: clean up a couple of more test failures due to missing TVirtuals
vkarpov15 Oct 16, 2025
d2b0ace
use RawDocType in default THydratedDocumentType only if not any
vkarpov15 Oct 16, 2025
4345355
apply id virtual correctly and fix remaining tests
vkarpov15 Oct 16, 2025
07a626b
Merge branch 'master' into 9.0
vkarpov15 Oct 20, 2025
a184bc0
Merge pull request #15518 from Automattic/vkarpov15/gh-13523-3
vkarpov15 Oct 21, 2025
1956262
upgrade to pre-release of mongodb node driver 7
vkarpov15 Oct 23, 2025
9c62784
install correct version of client-encryption
vkarpov15 Oct 23, 2025
7139e4a
Update docs/migrating_to_9.md
vkarpov15 Oct 23, 2025
663c759
WIP allow pre('init') hooks to overwrite arguments re: #15389
vkarpov15 Oct 27, 2025
a431200
merge conflict cleanup
vkarpov15 Oct 30, 2025
ebac5db
feat: allow overwriting middleware arguments in init()
vkarpov15 Oct 30, 2025
aca2560
fix lint
vkarpov15 Oct 30, 2025
7be6d35
Merge branch 'vkarpov15/mongodb-node-driver-next' of github.com:Autom…
vkarpov15 Oct 30, 2025
dc0316b
fix: omit hydrate option when calling watch()
vkarpov15 Oct 30, 2025
94c0e98
try fix tests
vkarpov15 Oct 30, 2025
ee73295
work around nyc weirdness
vkarpov15 Oct 31, 2025
7ae6142
Revert "work around nyc weirdness"
vkarpov15 Oct 31, 2025
e255560
try alternative approach to work around nyc weirdness
vkarpov15 Oct 31, 2025
617fc9f
better handling for parsing strings with nyc
vkarpov15 Oct 31, 2025
8b83a1f
Revert "better handling for parsing strings with nyc"
vkarpov15 Oct 31, 2025
0b1593e
Revert "try alternative approach to work around nyc weirdness"
vkarpov15 Oct 31, 2025
60064ad
try another fix
vkarpov15 Oct 31, 2025
8ef9a58
relax tests to avoid nyc weirdness
vkarpov15 Oct 31, 2025
86f2144
relax more tests
vkarpov15 Oct 31, 2025
ef7d423
Merge pull request #15697 from Automattic/vkarpov15/mongodb-node-driv…
vkarpov15 Oct 31, 2025
0ecd148
Merge branch 'master' into 9.0
vkarpov15 Nov 4, 2025
b0f4751
clean up merge conflicts
vkarpov15 Nov 4, 2025
dd280ba
feat: use mongodb 7
vkarpov15 Nov 7, 2025
cba094c
Merge branch '9.0' into vkarpov15/gh-15389-3
vkarpov15 Nov 7, 2025
6952e51
Update test/document.test.js
vkarpov15 Nov 7, 2025
e9a0509
add note about Document.prototype.updateOne callback removal
vkarpov15 Nov 7, 2025
a32ee02
address test fix for code review
vkarpov15 Nov 7, 2025
8d36dee
add overwriteMiddlewareArguments to TypeScript types and handle overw…
vkarpov15 Nov 7, 2025
44cf6c6
Update lib/document.js
vkarpov15 Nov 7, 2025
08bdf7a
Update test/document.test.js
vkarpov15 Nov 7, 2025
938869d
Merge pull request #15702 from Automattic/vkarpov15/gh-15389-3
vkarpov15 Nov 7, 2025
8229ae9
Update package.json
vkarpov15 Nov 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 0 additions & 204 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16, 18, 20, 22, 24]
node: [18, 20, 22, 24]
os: [ubuntu-22.04, ubuntu-24.04]
mongodb: [6.0.15, 7.0.12, 8.2.0]
include:
Expand Down
8 changes: 0 additions & 8 deletions browser.js

This file was deleted.

37 changes: 2 additions & 35 deletions docs/browser.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,4 @@
# Mongoose in the Browser

Mongoose supports creating schemas and validating documents in the browser.
Mongoose's browser library does **not** support saving documents, [queries](http://mongoosejs.com/docs/queries.html), [populate](http://mongoosejs.com/docs/populate.html), [discriminators](http://mongoosejs.com/docs/discriminators.html), or any other Mongoose feature other than schemas and validating documents.

Mongoose has a pre-built bundle of the browser library. If you're bundling your code with [Webpack](https://webpack.js.org/), you should be able to import Mongoose's browser library as shown below if your Webpack `target` is `'web'`:

```javascript
import mongoose from 'mongoose';
```

You can use the below syntax to access the Mongoose browser library from Node.js:

```javascript
// Using `require()`
const mongoose = require('mongoose/browser');

// Using ES6 imports
import mongoose from 'mongoose/browser';
```

## Using the Browser Library {#usage}

Mongoose's browser library is very limited. The only use case it supports is validating documents as shown below.

```javascript
import mongoose from 'mongoose';

// Mongoose's browser library does **not** have models. It only supports
// schemas and documents. The primary use case is validating documents
// against Mongoose schemas.
const doc = new mongoose.Document({}, new mongoose.Schema({
name: { type: String, required: true }
}));
// Prints an error because `name` is required.
console.log(doc.validateSync());
```
As of Mongoose 9, [Mongoose's browser build is now in the `@mongoosejs/browser` npm package](https://github.com/mongoosejs/mongoose-browser).
The documentation has been moved to the [`@mongoosejs/browser` README](https://github.com/mongoosejs/mongoose-browser?tab=readme-ov-file#mongoosejsbrowser).
23 changes: 8 additions & 15 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,13 @@ Below are the [semver](http://semver.org/) ranges representing which versions of

| MongoDB Server | Mongoose |
| :------------: | :--------------------------------------------: |
| `8.x` | `^8.7.0` |
| `7.x` | `^7.4.0 \| ^8.0.0` |
| `6.x` | `^6.5.0 \| ^7.0.0 \| ^8.0.0` |
| `5.x` | `^5.13.0` \| `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
| `4.4.x` | `^5.10.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0` |
| `4.2.x` | `^5.7.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0` |
| `4.0.x` | `^5.2.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.16.0` |
| `3.6.x` | `^5.0.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.8.0` |
| `3.4.x` | `^4.7.3 \| ^5.0.0` |
| `3.2.x` | `^4.3.0 \| ^5.0.0` |
| `3.0.x` | `^3.8.22 \| ^4.0.0 \| ^5.0.0` |
| `2.6.x` | `^3.8.8 \| ^4.0.0 \| ^5.0.0` |
| `2.4.x` | `^3.8.0 \| ^4.0.0` |
| `8.x` | `^8.7.0 | ^9.0.0` |
| `7.x` | `^7.4.0 \| ^8.0.0 \| ^9.0.0` |
| `6.x` | `^7.0.0 \| ^8.0.0 \| ^9.0.0` |
| `5.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
| `4.4.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
| `4.2.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
| `4.0.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.16.0` |
| `3.6.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.8.0` |

Mongoose `^6.5.0` also works with MongoDB server 7.x. But not all new MongoDB server 7.x features are supported by Mongoose 6.x.

Note that Mongoose `5.x` dropped support for all versions of MongoDB before `3.0.0`. If you need to use MongoDB `2.6` or older, use Mongoose `4.x`.
Loading
Loading