Sha256: 7324ea5e8cad800e18a680525769f1946034b8fe3a4ed6b530e42b13105180c2
Contents?: true
Size: 647 Bytes
Versions: 16
Compression:
Stored size: 647 Bytes
Contents
#!/usr/bin/env ruby require File.join(File.dirname(__FILE__), '_common.rb') db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB) if $DEBUG c = db.collection('remove1') c.clear 50.times { |i| c.insert(:a => i) } c = db.collection('remove2') c.clear c.insert(:a => 3, :b => 1) c.insert(:a => 3, :b => 3) c.insert(:a => 2, :b => 3) c.insert(:b => 3) end db.collection('remove1').clear db.collection('remove2').remove('a' => 3) if $DEBUG puts "remove1 count = #{db.collection('remove1').count}" puts "remove2 count = #{db.collection('remove2').count}" db.collection('remove2').find.each { |row| puts row.inspect } end
Version data entries
16 entries across 16 versions & 2 rubygems