示例#1
0
文件: set_test.go 项目: Wexcode/nabu
func makeSetIndex(ids ...int) indexes.Index {
	set := indexes.NewSetString("test")
	for _, id := range ids {
		set.Set(key.Type(id))
	}
	return set
}
示例#2
0
func makeSet(db *Database, name string, ids ...int) indexes.Index {
	index := indexes.NewSetString(name)
	for _, id := range ids {
		index.Set(key.Type(id))
	}
	if db != nil {
		addIndex(db, index)
	}
	return index
}
示例#3
0
文件: database.go 项目: Wexcode/nabu
func (db *Database) getOrCreateBigSetStringIndex(indexName string) indexes.Index {
	return db.getOrCreateIndex(indexName, func() indexes.Index {
		return indexes.NewSetString(indexName)
	})
}