read mongodb to generate urls