audit/db_index.go

16 lines
283 B
Go
Raw Normal View History

2021-08-09 04:33:23 +00:00
package audit
import (
"github.com/Selly-Modules/mongodb"
)
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)
}
}