Esempio n. 1
0
func addIndexes(conn *neoism.Database) {

	_, err := conn.CreateIndex("Key", "domain")
	if err != nil {
		app.Logger.Info("Failed to create index, probably already exists")
	}

	_, err = conn.CreateIndex("Key", "email")
	if err != nil {
		app.Logger.Info("Failed to create index, probably already exists")
	}
}
Esempio n. 2
0
func ensureIndexes(db *neoism.Database) {

	indexes, err := db.Indexes("Organisation")
	if err != nil {
		panic(err)
	}
	if len(indexes) == 0 {
		if _, err := db.CreateIndex("Organisation", "uuid"); err != nil {
			panic(err)
		}
		if _, err := db.CreateIndex("Industry", "uuid"); err != nil {
			panic(err)
		}
	}
}