Added auth code from examples, ensure Mongo is running before using