code: func (b *Backend) createMongoIndexes(database string) error {
  
  	tasksCollection := b.client.Database(database).Collection("tasks")
  
  	expireIn := int32(b.GetConfig().ResultsExpireIn)
  
  	_, err := tasksCollection.Indexes().CreateMany(context.Background(), []mongo.IndexModel{
  		{
  			Keys:    bson.M{"state": 1},
  			Options: options.Index().SetBackground(true).SetExpireAfterSeconds(expireIn),
  		},
  		mongo.IndexModel{
  			Keys:    bson.M{"lock": 1},
  			Options: options.Index().SetBackground(true).SetExpireAfterSeconds(expireIn),
  		},
  	})
  	if err != nil {
  		return err
  	}
  
  	return err
  }
docs: // createMongoIndexes ensures all indexes are in place