func DestroyMongoDB() { session, err := registry.CreateMongoDBClient() if err != nil { fmt.Printf("%s", err) } err = session.DB(registry.GetDatabaseName()).C(TABLE_NAME).DropCollection() if err != nil { fmt.Printf("%s", err) } }
// NildevInitMongoDB init func NildevInitMongoDB() { // In which environment we are env := registry.GetEnv() fmt.Printf("%s", env) session, err := registry.CreateMongoDBClient() if err != nil { fmt.Printf("%s", err) } err = session.DB(registry.GetDatabaseName()).C(TABLE_NAME).Create(&mgo.CollectionInfo{}) if err != nil { fmt.Printf("%s", err) } }