added codes for mongoDB