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 }
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 }