Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Different js export format #1

Open
sakulstra opened this issue Sep 24, 2019 · 2 comments
Open

Different js export format #1

sakulstra opened this issue Sep 24, 2019 · 2 comments

Comments

@sakulstra
Copy link

Hello, I tried using this package in quick patched it with:

const generateFromModels = async (modelsArray, options = {}) => {
+  modelsArray = modelsArray.map(m => m.default);

to work in our codebase as each model file might have multiple exports, but only the default one is a mongoose model.
Anyhow, i'd love to see a more sophisticated solution implemented right into the package 🤔

@jodevsa jodevsa closed this as completed Sep 25, 2019
@jodevsa jodevsa reopened this Sep 25, 2019
@jodevsa
Copy link
Owner

jodevsa commented Sep 29, 2019

Hi @sakulstra

Glad you liked it !

I'm actually thinking of creating a web UI tool that hooks as a mongoose plugin , which will contain multiple tools including the ERD geneator
ie:

if(env ==="dev"){
    mongoose.plugin(mongooseUI,{port:8080});
}

mongoose exposes all defined models in mongoose.models so it should be possible.

What do you think?

@jodevsa
Copy link
Owner

jodevsa commented Apr 25, 2021

Hi, please check #6 ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants