Caching MongoDB objects in PHP Caching MongoDB objects in PHP mongodb mongodb

Caching MongoDB objects in PHP


It's intentional, as collections have properties other than their names associated with them (w and wtimeout at the moment, more planned for the future). If all you care about are the names, then it's fine to cache them.


I've been passing the MongoCollection into my objects instead of the MongoDb. My reasoning was that choosing the collection in the object would be a hidden dependency (may be overkill) and then in my unit tests, I can mock the MongoCollection object.