add the function of reading data from mongo databases.