Access a remote mongodb with wordpress php

Solution:

Try to this one

$mongo = new MongoClient('mongodb://host:port', 
                        array('username'=>'yourname', 'pawssword'=>'yourpwd');
$db = $mongo->yourdbname;

I do not know what your error. I’m sorry about that but it works for me.