Hi All. I am struggling to get a connection to my mongo db to work. I have and account with mongohq. I am using Zend 2 and the mongo odm module available on github. I have tried:
'connection' => array(
'odm_default' => array(
'server' => 'flame.mongohq.com',
'port' => '<port>',
'user' => '<user>',
'password' => '<password>',
'dbname' => '<database>',
),
),
The result for that is:
flame.mongohq.com:27058: unauthorized db:doctrine lock type:-1 client:[CLIENT IP
So I tried:
'server' => 'mongodb://flame.mongohq.com/27058'
and the result for that is
Failed to connect to: mongodb:0: No such file or directory
I also tried defining the entire string and passing it to the server variable , i.e.
$mongoDns = sprintf('mongodb://%s:%s@%s:%s/%s',
'<user>',
'<password>',
'flame.mongohq.com',
'27058',
'<database>'
);
I get the same "failed to connect" result.
I also tried to pass the string above to the MongoClient function and then pass that object to the server variable. result
Failed to connect to: flame.mongohq.com:27058:27058: Couldn't get host info for flame.mongohq.com:27058
So, it looks to me like there is a bug somewhere. But I cant figure out where.
I tried the connection string and MongoClient function independently (not using the Zend 2 Module or Doctrine) and it connected fine.
Any thoughts? Is there anyone that has successfully connected to a host requiring authentication using the Mongo-ODM Zend 2 module?