Skip to content

Commit d90ccec

Browse files
authored
Merge pull request #15744 from YashSharma64/patch-1
Update browser.md with Mongoose limitations
2 parents 8061a20 + 8b8efd0 commit d90ccec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/browser.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ const doc = new mongoose.Document({}, new mongoose.Schema({
3535
// Prints an error because `name` is required.
3636
console.log(doc.validateSync());
3737
```
38+
39+
**Note:** The browser version of Mongoose supports only schema-based validation.
40+
Built-in validators (like `required`, `enum`, `minlength`) and custom validators work as expected using `validate()` or `validateSync()`.
41+
However, browser Mongoose does **not** support database operations, queries, or populate. Some features, like simplified models, document hooks (middleware), and defaults, are available in a limited capacity.
42+
Only document validation and limited model/document features are available in the browser build.

0 commit comments

Comments
 (0)