Class: Hash

Inherits:
Object show all
Defined in:
lib/jmongo/mongo/ruby_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_bsonObject



27
28
29
30
31
32
33
# File 'lib/jmongo/mongo/ruby_ext.rb', line 27

def to_bson
  obj = ::JMongo::BasicDBObject.new
  self.each_pair do |key, val|
    obj.put( key.to_s, val.to_bson )
  end
  obj
end