write results to mongodb collections