diff --git a/parser/courseParser.go b/parser/courseParser.go index 56e8c58..4a495db 100644 --- a/parser/courseParser.go +++ b/parser/courseParser.go @@ -47,7 +47,7 @@ func parseCourse(courseNum string, session schema.AcademicSession, rowInfo map[s course = &schema.Course{} - course.Id = schema.IdWrapper{ObjectID: primitive.NewObjectID()} + course.Id = schema.IdWrapper(primitive.NewObjectID().Hex()) course.Course_number = idMatches[2] course.Subject_prefix = idMatches[1] course.Title = rowInfo["Course Title:"] diff --git a/parser/professorParser.go b/parser/professorParser.go index 0e85f24..744c78e 100644 --- a/parser/professorParser.go +++ b/parser/professorParser.go @@ -29,7 +29,7 @@ func parseProfessors(sectionId schema.IdWrapper, rowInfo map[string]string, clas } prof = &schema.Professor{} - prof.Id = schema.IdWrapper{ObjectID: primitive.NewObjectID()} + prof.Id = schema.IdWrapper(primitive.NewObjectID().Hex()) prof.First_name = firstName prof.Last_name = lastName prof.Titles = []string{match[2]} diff --git a/parser/sectionParser.go b/parser/sectionParser.go index d98ccae..da7d556 100644 --- a/parser/sectionParser.go +++ b/parser/sectionParser.go @@ -21,7 +21,7 @@ func parseSection(courseRef *schema.Course, classNum string, syllabusURI string, section := &schema.Section{} - section.Id = schema.IdWrapper{ObjectID: primitive.NewObjectID()} + section.Id = schema.IdWrapper(primitive.NewObjectID().Hex()) section.Section_number = idMatches[1] section.Course_reference = courseRef.Id diff --git a/scrapers/events.go b/scrapers/events.go index cb059a9..31bbfdb 100644 --- a/scrapers/events.go +++ b/scrapers/events.go @@ -302,7 +302,7 @@ func ScrapeEvents(outDir string) { log.Printf("Scraped contact phone info: %s\n", contactInformationPhone) events = append(events, schema.Event{ - Id: schema.IdWrapper{ObjectID: primitive.NewObjectID()}, + Id: schema.IdWrapper(primitive.NewObjectID().Hex()), Summary: summary, Location: location, StartTime: dateTimeStart, diff --git a/scrapers/organizations.go b/scrapers/organizations.go index 94ad3d2..119ae00 100644 --- a/scrapers/organizations.go +++ b/scrapers/organizations.go @@ -222,7 +222,7 @@ func parseCsvRecord(ctx context.Context, entry []string) (*schema.Organization, log.Printf("Error retrieving image for %s: %v\n", entry[0], err) } return &schema.Organization{ - Id: schema.IdWrapper{ObjectID: primitive.NewObjectID()}, + Id: schema.IdWrapper(primitive.NewObjectID().Hex()), Title: entry[0], Categories: parseCategories(entry[1]), Description: entry[2], diff --git a/scrapers/profiles.go b/scrapers/profiles.go index aa14260..a7395b5 100644 --- a/scrapers/profiles.go +++ b/scrapers/profiles.go @@ -270,7 +270,7 @@ func ScrapeProfiles(outDir string) { log.Printf("Parsed list! #: %s, Office: %v\n\n", phoneNumber, office) professors = append(professors, schema.Professor{ - Id: schema.IdWrapper{ObjectID: primitive.NewObjectID()}, + Id: schema.IdWrapper(primitive.NewObjectID().Hex()), First_name: firstName, Last_name: lastName, Titles: titles,