Ejemplo n.º 1
0
func (u *User) Create(c *mgo.Collection) error {
	u.ID = bson.NewObjectId()
	u.Created = time.Now()
	u.Updated = time.Now()

	return c.Insert(u)
}
Ejemplo n.º 2
0
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)
}