perak / extract-mongo-schema

Extract schema from Mongo database, including foreign keys
71 stars 22 forks source link

Error: <g> attribute transform: Expected number, "translate(Infinity,20)scale(1)". i @ d3.v3.min.js:1 #10

Open ekaterina-lepunova opened 5 years ago

ekaterina-lepunova commented 5 years ago

https://user-images.githubusercontent.com/23632733/59427977-a6ae2000-8de4-11e9-8242-d270c3266645.png

Hi! Can you please check it out? I'm not able to create nor html diagram neither json file of my database schema.

Thanks, Kate

perak commented 5 years ago

Hi @katekozlova can you please help to reproduce this issue?

ekaterina-lepunova commented 5 years ago

@perak , thanks for the quick answer. Unfortunately I'm afraid I can't help. I just ran your app on my project with existing mongo db and it fails. I tried to run the app on a database with 1 and 2 schemas. It worked fine. However real db has 22 schemas. And it failed with empty html and empty json files. Probably you can give me a hint of a reason why it gave me an error to check schemas or something like this?

ekaterina-lepunova commented 5 years ago

@perak , you know I also tried this app: https://www.dbschema.com. However this app even haven't seen my db at all. Probably it may help. However Mongo Db Compass Community app sucessfully finds and shows me my database.

perak commented 5 years ago
ekaterina-lepunova commented 5 years ago

@perak , here are the screenshots. https://user-images.githubusercontent.com/23632733/59429582-c6474780-8de8-11e9-9469-8ea0deef3b39.png

https://user-images.githubusercontent.com/23632733/59429600-cd6e5580-8de8-11e9-9a82-20b6f3304be9.png

https://user-images.githubusercontent.com/23632733/59429625-d65f2700-8de8-11e9-8b42-95307b0f1d4c.png

perak commented 5 years ago

Your last screenshot tells me that extract mongo schema package is not properly installed. It is caused by dependency package used by this one.

I believe here is the solution of your trouble:

Screen Shot 2019-06-13 at 1 41 21 PM

It's something about compiling node-gyp under Windows. Do you have Linux or Mac somewhere (even in virtual machine?) - if so, please try running under Linux or Mac - it should work.

Hum... wait, you said that it worked with small database, but didn't work with "real" database? When it worked, did it worked on this machine? (the same machine where it cannot access "real" database)

ekaterina-lepunova commented 5 years ago

@perak , yeah the last screenshot showed the error after my try of downloading the app's source code. I wanted to debug it myself but it failed during "npm install" command. the first two screenshots were made from CMD when I just installed the package and tried to run it against my database.

perak commented 5 years ago

I think I can't help.

ekaterina-lepunova commented 5 years ago

ok, thanks.

perak commented 5 years ago

Sorry.

Problems on Windows are already reported before (and not fixed yet).

ekaterina-lepunova commented 5 years ago

Hi, @perak , I found the issue. My mongo db was running in the docker container and the app couldn't connect to it. I ran the app inside container and it worked. However unfortunately no dependencies were shown. So it wan't informative for me.

perak commented 5 years ago

@katekozlova program tries to automatically detects "links" by regex parsing the values, and it is made for specific case (I made it in need for one Meteor.js application). How your links look like? (I mean, is foreign key value numeric, or string... and if string, what length or format it is...). Maybe minimal change in the code can fit your needs.

perak commented 5 years ago

More specifically, this line: https://github.com/perak/extract-mongo-schema/blob/master/extract-mongo-schema.js#L51 tells program to check if string is foreign key only if it fits that regex rule. Wthout that condition, it will scan for links on each string (which could be slow, but functional).