"Invalid ns" when connecting to mongodb server
Perhaps your database name in your connection string or collection name (together they make a namespace) have special characters, and they make the namespace name illegal.
So you should make sure your connection string is ok.
For example, mine looks like
mongodb://mydblogin:mydbpassword@ds044444.mongolab.com:44444/mydatabase
Also make sure that collection name is legal.