I've been using the pure nim nimongo library for a while and it has been very useful.
I am attempting to get a project into full production and am wanting to move to a live database and am having trouble with that. Specifically, I have an account at mongodb.com (MongoDb Inc.'s Atlas)
But I'm having difficulty with it. Has anyone worked out a combination that works with this hoster and is willing to give details/hints?
John
My details:
The recommended connect string:
"mongodb+srv://<username>:<password>@cluster0-abcde.mongodb.net/test?retryWrites=true&w=majority"
(Hostname slightly mod'd above to not give out security details. And of course, I substitute the actual username/password.)
But that creates a dsn look failure. I figure that SRV isn't supported yet. Nor is listing the cluster's shards working AFAIK:
"mongodb://<username>:<password>@cluster0-shard-00-00-abcde.mongodb.net:27017,cluster0-shard-00-01-abcde.mongodb.net:27017,cluster0-shard-00-02-abcde.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true&w=majority"
But even when I use a single shard:
"mongodb://<username>:<password>@cluster0-shard-00-00-abcde.mongodb.net:27017"
It is not connecting. But neither am I getting a descriptive error. Simply a "cannot read from stream".
The Db is at version 4.0.11 and the password is encoded with SCRAM.
Never mind.
While I am still curious as to what is needed to get it to work, I gave up and created an account at cloudclusters.io and it worked on the first try.
Given the other providers are all running 3.x of MongoDb and they are running 4.0, I kind of wonder if MongoDb Inc. is running some kind of "purposely-incompatable-but-still-open-source" game to stop the other cloud providers. Just a guess given some of their other behaviors recently,
Update for sake of completeness: MongoDb Inc. didn't work simply because they require SCRAM-SHA-256 auth encryption on the cheaper accounts. Nimongo seems to only support SCRAM-SHA-1 at the moment.
So... it is not a conspiracy; simply a protocol mis-match for which I don't have a work-around.