mongo-ruby-driver/tests/mongo-qa/update

10 lines
289 B
Ruby
Executable File

#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), '_common.rb')
db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)
foo = db.collection('foo')
foo.update({:x => 1}, {:x => 1, :y => 2})
foo.update({:x => 2}, {:x => 1, :y => 7})
foo.update({:x => 3}, {:x => 4, :y => 1})