Sha256: c12ee551730089433ff9cca61d9856751d30a9a668697ccb50a843c2ae3f153d

Contents?: true

Size: 550 Bytes

Versions: 6

Compression:

Stored size: 550 Bytes

Contents

#!/usr/bin/env ruby

require File.join(File.dirname(__FILE__), '_common.rb')
db = Connection.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)

if $DEBUG
  3.times { |i| db.drop_collection("dbs_#{i+1}") }
end

def print_dbs_names(db)
  db.collection_names.select{ |n| n =~ /\.dbs/ }.sort.each { |name|
    puts name.sub(/^#{db.name}\./, '')
  }
end

db.collection('dbs_1').insert('foo' => 'bar')
db.collection('dbs_2').insert('psi' => 'phi')
puts db.name
print_dbs_names(db)
db.drop_collection('dbs_1')
db.create_collection('dbs_3')
print_dbs_names(db)

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
mongodb-mongo-0.13 test/mongo-qa/dbs
mongodb-mongo-0.14.1 test/mongo-qa/dbs
mongodb-mongo-0.14 test/mongo-qa/dbs
pahagon-mongo-abd-0.14.1 test/mongo-qa/dbs
mongo-0.15.1 test/mongo-qa/dbs
mongo-0.15 test/mongo-qa/dbs