예제 #1
0
func (s *Service) GetSessionInfo(sessionId string) (si SessionInformation, err error) {
	SessionQuery := bson.M{"sessionid": sessionId}
	db := s.DB.Copy()
	defer db.Close()
	err = db.FindOne("sessions", SessionQuery, &si)
	return si, err
}
예제 #2
0
func userExist(f *fishhub.Service, email string) bool {
	db := f.DB.Copy()
	defer db.Close()
	ui := UserProfile{}
	query := bson.M{"email": email}
	err := db.FindOne("users", query, &ui)
	if err == mgo.ErrNotFound {
		return false
	} else {
		return true
	}
	return false
}