Comments (5)
In case it isn't clear, the connection string is correct, I can connect to that database with those values when I use another client. This seems to be an issue with mongojs.
from mongojs.
The connection string you share in this issue - is that exact connection string valid? Because I get an auth error as well when using it with the mongo terminal console.
from mongojs.
I see what you mean; I was able to successfully connect by specifying the auth db:
mongo -u root -p s6m3ta7I9w711vCN2Xgz margindev-geoffmaker-db-0.azva.dotcloud.net:40769/maker_ad_planner --authenticationDatabase admin
Is there an equivalent of "--authenticationDatabase" in mongojs ?
from mongojs.
I know it is a bit late but according to the driver documentation you can use the authSource
option in the connection string to set the authentication database. You might want to give it a try.
from mongojs.
Hi,
when i use find method i got auth error.
code:
var databaseUrl = "mongodb://root:mean@localhost:/mydb";
var collections = ["users", "reports"]
var mongojs = require('mongojs');
var db = mongojs("mydb",['mycollection']);
db.mycollection.find({sex: "female"},function(err, docs) {
// docs is an array of all the documents in mycollection
console.log(err);
console.log(docs);
});
error:
mongodb\lib\mongodb\mongo_client.js:460
throw err
^
MongoError: auth failed
at Object.toError (C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\node_module
s\mongojs\node_modules\mongodb\lib\mongodb\utils.js:114:11)
at C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\node_modules\mongojs\node_m
odules\mongodb\lib\mongodb\db.js:1194:31
at C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\node_modules\mongojs\node_m
odules\mongodb\lib\mongodb\db.js:1903:9
at Server.Base.callHandler (C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\n
ode_modules\mongojs\node_modules\mongodb\lib\mongodb\connection\base.js:453:41)
at C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\node_modules\mongojs\node_m
odules\mongodb\lib\mongodb\connection\server.js:487:18
at MongoReply.parseBody (C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\node
modules\mongojs\node_modules\mongodb\lib\mongodb\responses\mongo_reply.js:68:5)
at null. (C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\node_modu
les\mongojs\node_modules\mongodb\lib\mongodb\connection\server.js:445:20)
at emit (events.js:107:17)
at null. (C:\Bitnami\meanstack-2.6.7-0\projects\mongojs\node_modu
les\mongojs\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:207:1
3)
at emit (events.js:110:17)
from mongojs.
Related Issues (20)
- Use native Object.assign instead of xtend HOT 1
- update `var` to `const` - Readme
- How to use collation HOT 2
- updateMany returns an error HOT 1
- Comparison with the official mongodb package
- Is $text supported within find()? HOT 1
- SCRAM-SHA-256 (and more)
- Publish version with mongodb ^3 HOT 3
- how to set remote connection to mongodb HOT 3
- How do i show dbs, similar to shell "show dbs" HOT 1
- Using replicaSet and readPreference option HOT 1
- "failed to connect to server" even after mongodb is back up HOT 1
- Compatible with hapijs 18? HOT 2
- MongoDB Atlas's URI does not work HOT 5
- collection.update no longer usable for overwriting an entry HOT 16
- v2.6.0 up to v3.1.0 update operation error! HOT 5
- .findOne() query just returns undefined on callback HOT 2
- Does this support aws document db?
- Found Vulnerability 'Regular Expression Denial of Service (ReDoS)' in Synk.io
- How to connect to mongo atlas?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongojs.