Added connection hooks for MongoDB.