Skip to content
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

extract schema how to connect url #1

Open
srs123 opened this issue Feb 28, 2018 · 4 comments
Open

extract schema how to connect url #1

srs123 opened this issue Feb 28, 2018 · 4 comments

Comments

@srs123
Copy link

srs123 commented Feb 28, 2018

I have mongo server url only my credential how to connect ?

i connect my url link some error "mongodb://QryUser3:Welqr7%40abc1@localhsot:27017/admin?readPreference=secondaryPreferred&replicaSet=test/test_db"

@perak
Copy link
Owner

perak commented Feb 28, 2018

I see “localhsot” instead “localhost” in the url

@srs123
Copy link
Author

srs123 commented Feb 28, 2018

example 192.168.1.10:27017 this server ip .
how to connect url using schema extract ?
its possible ?

@pvcon13
Copy link

pvcon13 commented Oct 29, 2019

Same question. under -d connectionstring I added username and password without a database name and if shows the top level structure in drawn html perfectly (thank you).

But if I then add at the end of the connection string (with the auth) the database name it throws a security exception.

So the connect string connects just find with username and password, .... but how do I select a database name on the command line?

I have 5 databases each with 1 to 4 collections. I do not mind outputting one at a time, just do not understand the syntax.... or do I have to change the security to permit this? Its an online system.

Any ideas would be great. Really love this tool for documenting Mongo.

@pvcon13
Copy link

pvcon13 commented Oct 29, 2019

When I use Mongo in this app, I connect first, then select DB and issue command with db. and that works if the security is only at the connection stage.

Reading you code it looks like to connect directly to the db? Is that the issue?
var getSchema = function(url, opts) {
var db = wait.forMethod(MongoClient, "connect", url);

var l = db.listCollections();
var collectionInfos = wait.forMethod(l, "toArray");
var schema = {};
var collections = {};

perak pushed a commit that referenced this issue Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants