CodeIgniter Forums
How to reduce MongoDB connection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: How to reduce MongoDB connection (/showthread.php?tid=48291)



How to reduce MongoDB connection - El Forum - 01-11-2012

[eluser]Unknown[/eluser]
Hello all,
I'm using a mongoDB library with Codeigniter.
I found that if I load the mongoDB library in model, it's one connection each loaded model.
Suppose that I have a page(controller method) that need to load data from 3 models. That means it's 3 mongoDB connections for that page.



How to reduce mongoDB connection to 1 connection per 1 controller method?

I think if I make model able to access library that has been loaded in controller, I will get 1 mongoDB connection per page. But how?

Thanks. ^___^