Permalink
Browse files

cursor.GetNext() should actually increment pos

  • Loading branch information...
mikejs committed Nov 23, 2009
1 parent 67ec2b8 commit 6b37869a36a1fed63f8f039082e7a9399cac7a42
Showing with 4 additions and 2 deletions.
  1. +4 −2 mongo.go
View
@@ -137,9 +137,11 @@ func (c *Cursor) HasMore() bool {
func (c *Cursor) GetNext() (BSON, os.Error) {
if c.HasMore() {
- return c.docs.At(c.pos).(BSON), nil
+ doc := c.docs.At(c.pos).(BSON);
+ c.pos = c.pos + 1;
+ return doc, nil;
}
- return Null, os.NewError("cursor failure");
+ return nil, os.NewError("cursor failure");
}
func (c *Cursor) GetMore() os.Error {

0 comments on commit 6b37869

Please sign in to comment.