SOLVED !! Here is the fix to avoid non-object error. Mongo.php
public function __construct( $config = array(), $connect = true ) {
if ( ! class_exists('\Mongo') ) {
// @codeCoverageIgnoreStart
throw new \My_Exception('The MongoDB PECL extension has not been
installed or enabled');
// @codeCoverageIgnoreEnd
}
$this->setConfig($config, $connect);
}
assign $config = array()
. So that result is always an array.