Commit b47cabc

Richard Luby <richluby@gmail.com>
2017-01-26 07:06:31
database keeps unique questions
no two questions can be the same
1 parent d938d3a
Changed files (1)
db.go
@@ -35,7 +35,7 @@ func InitDBSession() (*mgo.Session, error) {
 	if err != nil {
 		return nil, err
 	}
-	index := mgo.Index{Key: []string{"categorystring"},
+	index := mgo.Index{Key: []string{"question"},
 		DropDups: true,
 		Unique:   true}
 	DBsession.DB(DB_config.DB_name).C(DB_config.CollectionName).EnsureIndex(index)