I'm using MongoDB w/ CI and came up with the following. It works for me, but I'm sure it can be tweaked somewhat. I'll worry about tweaking it later but right now it does what I want.
I created a model called "database_conn.php"
class Database_Conn extends Model {
function _connect() {
$m = new Mongo();
$db = $m->selectDB( "YOUR DATABASE NAME" );
return $db;
}
}
Then, if I need to connect to a collection from my models.
$collection = Database_Conn::_connect()->selectCollection( "COLLECTION NAME" );