What's the best way to connect to mongo (on a remote server) from c#?
Story so far
I've had no end of hassle trying to do a simple find from a very basic c# console app connecting to mongo labs.
I was able to connect using both Mongo Shell and RoboMongo and query the collection I had set up. But I still couldn't do the same with my c# code - even though I was using exactly the same credentials. Primarily it was timing out whenever I tried to actually execute a find against the collection I had set up within the database.
All of the help information / examples / etc. out there is Waaaaaaaaaaaaay too old to be useful.
I'm using mLabs mongo connection template - pretty standard stuff
mongodb://<dbuser>:<dbpassword>@<serverName>.mlab.com:<port>/<databaseName>
And doing very standard things to try and read from the collection - but no go, it always times out. Buried in the exception returned was a reference to authentication failed. And inspecting the various objects I could see that for one of the authentication related members was blank.
So to restate the question - what's the best way to connect to a remote mongo repository using c#? Bonus points if it includes best practice for handling all of the good stuff, e.g. clusters, replication sets, etc.