Added support for passing an existing mongodb databse object