Adding conversion to document format for mongo.