0

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?

2
  • Have a look on this question forum.codeigniter.com/thread-63035.html Commented Dec 7, 2016 at 6:47
  • CodeIgniter doesn't provide a MongoDB adapter. Commented Dec 8, 2016 at 16:08

1 Answer 1

1

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.