Sha256: b3abac9881c28720b82ab0241b7765fd07d8cd65bd5a627ce54b300ec4688f0f

Contents?: true

Size: 307 Bytes

Versions: 2

Compression:

Stored size: 307 Bytes

Contents

module Mongo
  class DB
    def nolock_eval(code, *args)
      if not code.is_a? BSON::Code
        code = BSON::Code.new(code)
      end

      oh = BSON::OrderedHash.new
      oh[:$eval] = code
      oh[:args]  = args
      oh[:nolock] = true

      doc = command(oh)
      doc['retval']
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid_ext-0.6.2 lib/mongoid_ext/patches.rb
mongoid_ext-0.6.1 lib/mongoid_ext/patches.rb