persisting the component to mongoDB