Connection to MongoDB and output