Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How can I change my mongodb hostname dynamic ?

  • If I want to change the database hostname ip base on my program. How can I do it ? 
    I don't want to use the one the hard code in the db.php

    \Mongo_Db::instance('my_instance');

    Thanks
  • HarroHarro
    Accepted Answer
    You can have multiple configurations in your db.php config:

    'mongo' => array(

        'default' => array( ... ),
        'my_instance' => array( ... ),
    ),

    And you can add it dynamically if you want:

    \Config::set('db.mongo.my_instance', array( ... ));
  • Thanks Harro

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion