Sha256: b58912dc88a7e436546a5a161d6e6f8d9ef6a90a7f33adeef235aca887324148

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'mongo'

connection = Mongo::Connection.new( 'localhost', 27018 )
db = connection.db( 'admin' )
db.authenticate( 'admin', 'admin')

db_name = "fernand_mdb"
cltn_name = "blee"


db = connection.db( db_name )

cltn = db.create_collection( cltn_name )
cltn.remove

10.times do |i|
  row = { :name => "fred_#{i}", :last_name => "Blee_#{i}" }
puts "Inserting row #{row.inspect}"  
  cltn.insert( row )
end

cltn = db[cltn_name]
puts ""
puts "Inserted `#{cltn.count} records in `#{cltn_name}"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo3-0.0.4 data/populate