Added some functionality for the mongodb connection