mongodb-atlas

MongoDB Atlas authentication failed on Python

给你一囗甜甜゛ 提交于 2019-12-01 08:38:54
问题 I have deployed this Python app on Heroku and i want it to connect to a MongoDB Atlas cluster. I used my string to connect to the cluster, but for some reason i keep getting raise OperationFailure(msg % errmsg, code, response) pymongo.errors.OperationFailure: bad auth Authentication failed. I checked twice and both the user and the password are correct. Any idea on why this is happening? from pymongo import MongoClient import time import random import time import datetime client = MongoClient

How to use new URL from mongodb 3.6 to connect from golang

六月ゝ 毕业季﹏ 提交于 2019-11-29 17:29:19
I tried to connect to mongodb Atlas using golang drivers. tlsConfig := &tls.Config{} var mongoURI = "mongodb+srv://admin:password@prefix.mongodb.net:27017/dbname" dialInfo, err := mgo.ParseURL(mongoURI) if err != nil { panic(err) } dialInfo.DialServer = func(addr *mgo.ServerAddr) (net.Conn, error) { conn, err := tls.Dial("tcp", addr.String(), tlsConfig) return conn, err } session, err := mgo.DialWithInfo(dialInfo) if err != nil { println("error") log.Fatal(err) } _ = session c := session.DB("Token").C("_Users") user := &User{firstName: "username"} err = c.Insert(user) if err != nil { println(

Connect laravel jenssegers to mongodb atlas cluster

偶尔善良 提交于 2019-11-27 16:59:26
问题 I'am starting with Mongodb atlas and i trying to connect my laravel/jenssegers project to the cluster i config my conf/database 'mongodb' => [ 'driver' => 'mongodb', 'host' => env('DB_HOST'), 'port' => env('DB_PORT', '27017'), 'database' => env('DB_DATABASE'), 'username' => env('DB_USERNAME'), 'password' => env('DB_PASSWORD'), 'options' => [ 'database' => 'admin' // sets the authentication database required by mongo 3 ] ], And my .env file DB_HOST="xxxx-shard-00-00-uggj0.mongodb.net" DB_PORT

Fail to connect Mongoose to Atlas

空扰寡人 提交于 2019-11-26 16:18:16
问题 I'm always connecting to the "admin" DB, which is a fixed bug. Using Mongoose 5.0.6 MongoDb 3.6 and trying to connect to Atlas. My question, what driver Mongoose 5.0.6 depend on? How can I find out when Mongoose will have that fix? On a different direction, is there a way to connect with MongoDB then use this connection with Mongoose? Cheers 回答1: Basically you should try connecting with your url link, and specify the DB name on the mongoose connect method so if your cluster link is: mongodb