intergrated the mongodb method