如何在CodeIgniter中设置MongoDB数据库连接超时?

I need to set a timeout for MongoDB Codeigniter Connection. My config file is

          $config['mongo_db']['active'] = 'default';
          $config['mongo_db']['default']['no_auth'] = FALSE;
          $config['mongo_db']['default']['hostname'] = 'SHLY_DBSERVER';
          $config['mongo_db']['default']['port'] = '27018';
          $config['mongo_db']['default']['username'] = 'user';
          $config['mongo_db']['default']['password'] = '123';
          $config['mongo_db']['default']['database'] = 'testdb';
          $config['mongo_db']['default']['db_debug'] = TRUE;
          $config['mongo_db']['default']['return_as'] = 'array';
          $config['mongo_db']['default']['write_concerns'] = (int)1;
          $config['mongo_db']['default']['journal'] = TRUE;
          $config['mongo_db']['default']['read_preference'] = NULL;
          $config['mongo_db']['default']['read_preference_tags'] = NULL;
          $config['mongo_db']['default']['no_auth'] = FALSE;

is there any way to set that option from here?

It's fixed with following manners like :

$config['mongo_db']['timeout'] = 100 or -1;

Otherwise check like above syntax:

$cursor = $collection->find();
$cursor->timeout(-1);