Skip to content

Commit

Permalink
Merge pull request #23 from PascalLeMerrer/issue#22
Browse files Browse the repository at this point in the history
Fixed issue #22: total item count is 0.
  • Loading branch information
diegogub committed Dec 11, 2015
2 parents 1cc9f5d + 9aa0311 commit 7325c23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (c *Cursor) FetchBatch(r interface{}) error {
// fetch next batch
if c.HasMore() {
res, err := c.db.send("cursor", c.Id, "PUT", nil, c, c)

if res.Status() == 200 {
return nil
}
Expand Down Expand Up @@ -142,6 +141,10 @@ func (c *Cursor) Next(r interface{}) bool {
}

type Extra struct {
Stats Stats `json:"stats"`
}

type Stats struct {
FullCount int `json:"fullCount"`
}

Expand All @@ -150,7 +153,7 @@ func (c Cursor) Count() int {
}

func (c *Cursor) FullCount() int {
return c.Data.FullCount
return c.Data.Stats.FullCount
}

func (c Cursor) HasMore() bool {
Expand Down

0 comments on commit 7325c23

Please sign in to comment.