audit/db_index.go

16 lines
286 B
Go
Raw Normal View History

2021-08-09 04:33:23 +00:00
package audit
import (
2022-10-10 03:42:39 +00:00
"git.selly.red/Selly-Modules/mongodb"
2021-08-09 04:33:23 +00:00
)
func (s Service) indexDB() {
// Index key
2021-08-17 08:54:06 +00:00
commonIndex := mongodb.NewIndexKey("target", "targetId")
2021-08-09 04:33:23 +00:00
2021-08-17 08:54:06 +00:00
// Index all targets
2021-08-17 07:29:47 +00:00
for _, target := range s.Targets {
2021-08-09 04:33:23 +00:00
mongodb.CreateIndex(getColName(target), commonIndex)
}
}