Sha256: 4cca3b8b088069c78145d854f61d6d9b8b4df57ec687adc389f45b6a86804100
Contents?: true
Size: 266 Bytes
Versions: 4
Compression:
Stored size: 266 Bytes
Contents
require 'adapter/mongo' Adapter.define(:mongo_atomic, Adapter::Mongo) do def write(key, value) criteria = {:_id => key_for(key)} updates = {'$set' => encode(value)} client.update(criteria, updates, :upsert => true, :safe => options[:safe]) end end
Version data entries
4 entries across 4 versions & 1 rubygems