Sha256: 5581c3bc7fd405dce486bef70dabaaf72492e4cb30af5af4274b8e76e03c79d0

Contents?: true

Size: 411 Bytes

Versions: 5

Compression:

Stored size: 411 Bytes

Contents

require 'rubygems'
require 'pathname'

root_path = Pathname(__FILE__).dirname.join('..').expand_path
lib_path  = root_path.join('lib')
$:.unshift(lib_path)

require 'adapter/mongo'

key     = BSON::OrderedHash['s' => 1, 'n' => 1]
client  = Mongo::Connection.new.db('adapter')['testing']
adapter = Adapter[:mongo].new(client)
adapter.clear

adapter.write(key, :v => 1)

doc = adapter.read(key)

puts doc.inspect

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adapter-mongo-0.8.1 examples/object_for_key.rb
adapter-mongo-0.8.0 examples/object_for_key.rb
adapter-mongo-0.7.0 examples/object_for_key.rb
adapter-mongo-0.6.0 examples/object_for_key.rb
adapter-mongo-0.5.6 examples/object_for_key.rb