Document db and index creation