From 5cdf60f157e7e3bfc532aa46b318de7120fe54b4 Mon Sep 17 00:00:00 2001 From: Jim Menard Date: Wed, 17 Dec 2008 11:43:00 -0500 Subject: [PATCH] simplified example --- examples/simple.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/examples/simple.rb b/examples/simple.rb index 338ee78..3535b23 100644 --- a/examples/simple.rb +++ b/examples/simple.rb @@ -11,14 +11,7 @@ db = Mongo.new(host, port).db('ruby-mongo-examples-simple') coll = db.collection('test') coll.clear -doc = {'a' => 1} -coll.insert(doc) - -doc = {'a' => 2} -coll.insert(doc) - -doc = {'a' => 3} -coll.insert(doc) +3.times { |i| coll.insert({'a' => i+1}) } puts "There are #{coll.count()} records in the test collection. Here they are:" coll.find().each { |doc| puts doc.inspect }