Random cursor fun facts.

This commit is contained in:
Jim Menard 2009-02-03 12:43:22 -05:00
parent 04b0b926d4
commit c630940c46
2 changed files with 13 additions and 1 deletions

View File

@ -217,6 +217,18 @@ object or call the :strict= method:
The method DB#strict? returns the current value of that flag.
== Cursors
Random cursor fun facts:
- Cursors are enumerable.
- The query doesn't get run until you actually attempt to retrieve data from a
cursor.
- Cursors have a to_a method.
= Testing

View File

@ -35,6 +35,6 @@ coll.insert('array' => [1, 2, 3],
'null' => nil,
'symbol' => :zildjian)
coll.find().each { |row| pp row }
pp coll.find().next_object
coll.clear