Added support for reading and saving to mongodb