-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Browser Model #4292
Milestone
Comments
I've run into the same problem. Maybe this abstracted shared schema module could work for you (with CommonJS):
Now you can require the abstracted schema definition from client and server side like this:
My thoughts. |
I like this idea. Hasn't really been a high priority since getting documents and schemas to work in the browser was already quite an odyssey |
vkarpov15
added a commit
that referenced
this issue
Jun 17, 2023
vkarpov15
added a commit
that referenced
this issue
Jul 16, 2023
vkarpov15
added a commit
that referenced
this issue
Aug 6, 2023
vkarpov15
added a commit
that referenced
this issue
Sep 26, 2023
vkarpov15
added a commit
that referenced
this issue
Sep 26, 2023
vkarpov15
added a commit
that referenced
this issue
Oct 4, 2023
vkarpov15
added a commit
that referenced
this issue
Oct 4, 2023
Allow importing Mongoose without any MongoDB specifics, take 2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although 90% of "model.js" doesn't make sense in the browser I think implementing it with some basic features (like creating a schema from an object and storing the model name) would be handy to make the following code easier to be isomorphic.
Currently I have to separate out that schema if I want to use it in the browser, also I have to explicitly pass around the modelName since schema's don't have names.
Thoughts?
The text was updated successfully, but these errors were encountered: