extract-mongo-schema icon indicating copy to clipboard operation
extract-mongo-schema copied to clipboard

extract schema how to connect url

Open srs123 opened this issue 7 years ago • 4 comments

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"

srs123 avatar Feb 28 '18 07:02 srs123

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

perak avatar Feb 28 '18 08:02 perak

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

srs123 avatar Feb 28 '18 08:02 srs123

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 avatar Oct 29 '19 14:10 pvcon13

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 = {};

pvcon13 avatar Oct 29 '19 14:10 pvcon13