From c630940c46197bbb6db5a1b1673ede8e71192601 Mon Sep 17 00:00:00 2001 From: Jim Menard Date: Tue, 3 Feb 2009 12:43:22 -0500 Subject: [PATCH] Random cursor fun facts. --- README.rdoc | 12 ++++++++++++ examples/types.rb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 248af2c..b392f8f 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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 diff --git a/examples/types.rb b/examples/types.rb index f04d3df..4c9998f 100644 --- a/examples/types.rb +++ b/examples/types.rb @@ -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