Connect to Mongo Shell on OpenShift I have a gear running a instance of mongoDB. I wish to connect to the mongo shell. How can I do it?

I have rhc and mongoDB installed on my computer.

I have RockMongo on the gear, but I cannot create a geospatial index from RockMongo.

I used rhc port-forward whic didn't give any error.

and then tried to connect using the following.

mongo -u&lt;your mongodb user name&gt; -p&lt;the password for mongoDB&gt;  --host &lt;the ip number for mongoDB&gt; --port &lt;the port number&gt; &lt;app name&gt; 


for host I used the localhost address because I have port forward running. Now I can connect but every command i use results in "errmsg" : "unauthorised"
Work Arround

I used PuTTY to connect to the gear and form there I could connect to the mongo shell, and thus  solved the issue.

Some Articles that might be helpfull to others.


Remote Access to Your Application.
connecting-to-mongodb-gear-using-your-local-mongo-client-and-rhc-port-forwarding.