Added the functionality of inserting a document into MongoDB