Closed
Description
Hi again,
I would like to use the MongoDB connection outside of a Model (ie. a custom class not dependant of a specific collection).
So far:
DB::getMongoDB() does'nt work (dependency issue, couldn't resolve)
DB::connection('mongodb') returns NULL
What is the best practice?
A) still use your IoC ? Then how can I proceed?
B) Open the connection using the original Mongo PHP library, everytime I need it ? Isn't it efficient because it might trigger multiple connections instead of a single instance?
Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels