timetable-mgr/src/dbAccess/corpus.go

26 lines
476 B
Go
Raw Normal View History

2024-03-26 16:32:00 +00:00
package dbAccess
import (
"context"
)
const corpusCollection = "corpus"
const stationsCollection = "stations"
func dropExistingCorpus() error {
database := MongoClient.Database(databaseName)
collection := database.Collection(corpusCollection)
err := collection.Drop(context.Background())
if err != nil {
return err
}
collection = database.Collection(stationsCollection)
err = collection.Drop(context.Background())
if err != nil {
return err
}
return nil
}