session, err := mgo.Dial("localhost:27017")
if err != nil {
log.Println("err: ", err)
return
}
defer session.Close()
// Optional. Switch the session to a monotonic behavior.
session.SetMode(mgo.Monotonic, true)
c := session.DB("logs").C("log_event")