fetching the data from mongodb works perfectly