-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mongoose browser implementation #9273
Comments
As long as you use Webpack and your webpack config has Thanks for pointing out that we already have a pre-built bundle, this section of the docs is out of date after #8435 |
I found a bit of a bug in the UMD build: the below script would fail because older versions of Babel didn't support 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()); |
Just to clarify, you can still use |
@vkarpov15 I don't know if I should open a new ticket or not.
|
@gilles-yvetot are you using You should be safe to ignore that warning or stub out mongodb-client-encryption using webpack externals. |
Do you want to request a feature or report a bug?
Feature -> docs
Problem
@vkarpov15 I am not sure to understand the mongoose browser documentation. I have been a user of mongoose for many years now (❤️ ) but I am struggling to understand it.
const mongoose = require('mongoose')
withconst mongoose = require('mongoose/browser')
? I am using ES6 everywhereWhat are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node 12
Mongoose 5.9.25
Mongo 4.2
The text was updated successfully, but these errors were encountered: