This a much-simplified version of #25, the main difference is I am using mgo's builtin ParseURL function instead of string parsing stuff myself: https://godoc.org/gopkg.in/mgo.v2#ParseURL.
The mongodb url+credentials are provided via the format (has to start with mongodb:// for mgo.ParseURL to parse it):
mongodb://<user>:<password>@host:port/database
The "-url" parameter was lightly modified to support/explain this:
-url string
[Optional] The database server's url, in the format of mongodb://[<user>:<password>@]<host>[:<port>]. Defaults to mongodb://localhost:27017
So if you wanted to auth as 'tim' and password '123456', here is what your -url flag would look like:
This a much-simplified version of #25, the main difference is I am using mgo's builtin ParseURL function instead of string parsing stuff myself: https://godoc.org/gopkg.in/mgo.v2#ParseURL.
The mongodb url+credentials are provided via the format (has to start with mongodb:// for mgo.ParseURL to parse it):
The "-url" parameter was lightly modified to support/explain this:
So if you wanted to auth as 'tim' and password '123456', here is what your -url flag would look like:
If auth is enabled on a server but no credentials are provided, flashback will die with "not authorized to execute op" errors.