adding the MongoDB code