# File lib/moneta/adapters/mongo.rb, line 63 def load(key, options = {}) key = to_binary(key) doc = @collection.find_one('_id' => key) if doc && (!doc[@expires_field] || doc[@expires_field] >= Time.now) expires = expires_at(options, nil) @collection.update({ '_id' => key }, # @expires_field must be a Time object (BSON date datatype) { '$set' => { @expires_field => expires || nil } }) if expires != nil doc_to_value(doc) end end