diff --git a/lib/mongo/cursor.rb b/lib/mongo/cursor.rb index 370a355..85f139c 100644 --- a/lib/mongo/cursor.rb +++ b/lib/mongo/cursor.rb @@ -88,6 +88,7 @@ module Mongo doc end + alias :next :next_document # Reset this cursor on the server. Cursor options, such as the # query string and the values for skip and limit, are preserved. diff --git a/test/cursor_test.rb b/test/cursor_test.rb index e7ae52d..a3e30ef 100644 --- a/test/cursor_test.rb +++ b/test/cursor_test.rb @@ -395,10 +395,13 @@ class CursorTest < Test::Unit::TestCase end cursor = @@coll.find + n = 0 while cursor.has_next? - assert cursor.next_document + assert cursor.next + n += 1 end + assert_equal n, 200 assert_equal false, cursor.has_next? end