From bfbc71e60f8095a758d96db98249779b113d1173 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 4 Apr 2011 11:24:27 -0400 Subject: [PATCH] minor: more idiomatic example in README --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0d21542..ea21b7d 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,18 @@ for much more: require 'rubygems' require 'mongo' - include Mongo - db = Connection.new.db('sample-db') - coll = db.collection('test') + @conn = Mongo::Connection.new + @db = @conn['sample-db'] + @coll = @db['test'] - coll.remove + @coll.remove 3.times do |i| - coll.insert({'a' => i+1}) + @coll.insert({'a' => i+1}) end - puts "There are #{coll.count()} records. Here they are:" - coll.find().each { |doc| puts doc.inspect } + + puts "There are #{@coll.count} records. Here they are:" + @coll.find.each { |doc| puts doc.inspect } # Installation