Fix CIF Indexes
All checks were successful
Go Test / test (push) Successful in 31s

This commit is contained in:
Fred Boniface 2024-04-23 16:54:29 +01:00
parent 16bff981cc
commit 652d900618

View File

@ -157,34 +157,34 @@ func CreateTimetableIndexes() error {
coll := MongoClient.Database(DatabaseName).Collection(TimetableCollection)
indexModels := []mongo.IndexModel{
{
Keys: bson.M{
"trainUid": 1,
"stpIndicator": 1,
"scheduleStartDate": 1,
Keys: bson.D{
{Key: "trainUid", Value: 1},
{Key: "stpIndicator", Value: 1},
{Key: "scheduleStartDate", Value: 1},
},
Options: options.Index().SetName("delete_query"),
},
{
Keys: bson.M{
"trainUid": 1,
"scheduleStartDate": 1,
"scheduleEndDate": 1,
"daysRun": 1,
Keys: bson.D{
{Key: "trainUid", Value: 1},
{Key: "scheduleStartDate", Value: 1},
{Key: "scheduleEndDate", Value: 1},
{Key: "daysRun", Value: 1},
},
Options: options.Index().SetName("find_by_uid"),
},
{
Keys: bson.M{
"headcode": 1,
"scheduleStartDate": 1,
"scheduleEndDate": 1,
"daysRun": 1,
Keys: bson.D{
{Key: "headcode", Value: 1},
{Key: "scheduleStartDate", Value: 1},
{Key: "scheduleEndDate", Value: 1},
{Key: "daysRun", Value: 1},
},
Options: options.Index().SetName("find_by_headcode"),
},
{
Keys: bson.M{
"serviceDetail.vstp": 1,
Keys: bson.D{
{Key: "serviceDetail.vstp", Value: 1},
},
Options: options.Index().SetName("vstp"),
},