func (u *User) Create(c *mgo.Collection) error { u.ID = bson.NewObjectId() u.Created = time.Now() u.Updated = time.Now() return c.Insert(u) }
func AddKeyword(org model.Organization, c *mgo.Collection) { keyword := model.Keyword{ OrgID: org.ID, Name: org.Name, Short: util.ShortenOrgName(org.Name), IsGeneral: true, Sub: []string{}, } c.Insert(keyword) }