audit/db_index.go

16 lines
301 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
commonIndex := mongodb.NewIndexKey("source", "target", "targetId")
// Index all allowed sources
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)
}
}