Skip to content

Instantly share code, notes, and snippets.

@mwmahlberg
Created February 19, 2016 16:14
Show Gist options
  • Save mwmahlberg/dc128d557c0c3c13a0ec to your computer and use it in GitHub Desktop.
Save mwmahlberg/dc128d557c0c3c13a0ec to your computer and use it in GitHub Desktop.
Script for connecting to mongod/mongos without the need to type in authInfo
#!/bin/bash
USER="foo"
PASS="bar"
AUTHDB="someDb"
mongo $1 -u $USER -p $PASS --authenticationDatabase $AUTHDB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment