audit/db_index.go

16 lines
286 B
Go

package audit
import (
"git.selly.red/Selly-Modules/mongodb"
)
func (s Service) indexDB() {
// Index key
commonIndex := mongodb.NewIndexKey("target", "targetId")
// Index all targets
for _, target := range s.Targets {
mongodb.CreateIndex(getColName(target), commonIndex)
}
}