fix: remove count check on cursor

This commit is contained in:
Lakhan Samani 2021-12-20 18:32:36 +05:30
parent bedc3d0b50
commit a933ac1118

View File

@ -2,7 +2,6 @@ package db
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"log" "log"
"time" "time"
@ -199,11 +198,6 @@ func (mgr *manager) GetUserByID(id string) (User, error) {
} }
defer cursor.Close() defer cursor.Close()
count := cursor.Count()
if count == 0 {
return user, errors.New("user not found")
}
for { for {
if !cursor.HasMore() { if !cursor.HasMore() {
if user.Key == "" { if user.Key == "" {