implement mongo pipeline tor store data into mongodb