I try to connect compose mongodb in bluemix with golang program but i get unsupported connection url option ssl. Here I give mongodb connection string got from composedb console. How to connect with remote host need syntax for connect?
session, err := mgo.Dial("mongodb://****:****@aws-us-east-1-portal.26.dblayer.com:20258/admin?ssl=true")
if err != nil {
panic(err)
}
defer session.Close()
// Optional. Switch the session to a monotonic behavior.
session.SetMode(mgo.Monotonic, true)
c := session.DB("test").C("people")
err = c.Insert(&Person{"Ale", "+55 53 8116 9639"},
&Person{"Cla", "+55 53 8402 8510"})
if err != nil {
log.Fatal(err)
}
The error:
panic: unsupported connection URL option: ssl=true
goroutine 1 [running]:
panic(0x2130a0, 0xc82000a840)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
main.main()
/Users/vit/gocode/src/mongmix/mmix.go:19 +0x9b
exit status 2