added the mongodb reading part