mongolab / mongodb-uri-node Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I set up my config like this:
var config = {
"scheme": "mongodb",
"hosts": [
{
"host": "ds1111-a1.mongolab.com",
"port": 1234
}
],
"username": "user:n@me",
"password": "p@ssword",
"options": {
"authSource": "@dmin"
},
"database": "d@tabase"
}
Then:
var uriUtil = require('mongodb-uri');
var mongodbUri = uriUtil.format(config);
var mongooseUri = uriUtil.formatMongoose(mongodbUri);
mongoose.connect(mongooseUri);
The app connects to the db successfully, but when I make a query, I get this error: 'MongoError: not authorized for query on 'dbname.coll'
Since it's pointing to auth, I tried with the username and password in the options, but I still get same error.
Any ideas on what's causing this?
Hi, I would love to take over this package and unify all the "mongoDB URI builders" out there under one roof.
We need a MongoDB URI builder lib, and there are a lot of them, but they are all outdated and not maintained anymore.
I build this GUI tool for MongoDB URI and also the Mingo -- The best GUI for MongoDB.
Can I please take over this lib and continue in work you started?
Thanks!
This nice tool should also support IPv6 addresses. In 2022 it is getting more and more relevant.
None of these are currently working:
uriObj = mongoURI.parse("mongodb://user:password@[::1]:27017/mip?authSource=admin");
uriObj = mongoURI.parse("mongodb://user:password@[fe80::81e6:5666:f147:7ef8]:27017/mip?authSource=admin");
uriObj = mongoURI.parse("mongodb://[fe80::81e6:5666:f147:7ef8]:27017/mip?authSource=admin");
uriObj = mongoURI.parse("mongodb://[::1]:27017");
See my proposal at https://github.com/Wernfried/mongodb-uri-node/blob/patch-1/mongodb-uri.js
Best Regards
Wernfried
Hi, would it be possible to have the hosts
parameter as a string and not an array?
I'm building a GUI for MongoDB URI Builder https://manage.mingo.io/tool/mongodb-uri-builder and as you can see, I have the Hosts field only as one input.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.