Hi All,
I really need some help here as I am unable to connect
Pharo to MongoDB Atlas Cluster service:
http://cloud.mongodb.com.
(This service gives a free 500 MB MongoDB cluster on the cloud and
thereafter larger on subscription)
I have got stuck in my application development.
The connection is thru MongoDB (client) Drivers and the connection string
typically is given as
'mongodb+srv://<username>:<password>@yyyy.xxxxx.mongodb.net/<mydefaultdatabase>?retryWrites=true&w=majority"
Ques 1.:
is MongoClient required ?
though Atlas service is a cluster the manual for Atlas states
'MongoDB drivers automatically attempt server selection following a
cluster election or failover event. By
default, the C driver immediately raises an error if its first attempt to
select a server fails. ...'
in any case MongoClient will probably fail in the following line at
initializeWith:
...
initialUrlStrings := initialUrls collect: [:each | each asMongoUrl
asMongoUrlString ].
as
asMongoUrl will not work with the scheme 'mongodb+srv'
Ques 2:
Can we directly connect thru class Mongo. However the specified connect
string above would not go thru
So can someone pls help on how to connect or work around this
Sanjay Minni wrote
Hi
can anyone pls help me with an example of connecting to a MongoDB Atlas
cluster (their cloud service).
My Atlas cluster replica set is at the urls
yyyy-shard-00-00.xxxxx.mongodb.net:27017
yyyy-shard-00-01.xxxxx.mongodb.net:27017
yyyy-shard-00-02.xxxxx.mongodb.net:27017
The MongoDB Atlas website specifies the application connectstring as
'mongodb+srv://
<username>
:
<password>
@yyyy.xxxxx.mongodb.net/
<mydefaultdatabase>
?retryWrites=true&w=majority"
I saw the doc / example on pharo-nosql/mongotalk but could not figure out
in
MongoClient -
1. how to get embed the username:password in the connectstring which i
feel
would be needed,
2. how to specify the default database
3. is it required to specify all three members while Mongo suggests a
single
part connect string which probably must be covering the cluster
thanks
-----
cheers,
Sanjay
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
-----
cheers,
Sanjay
--
Sent from:
http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html