Extract `Moped::BSON::Document` attributes in Ruby hash
问题 In Mongoid 3.0.21, how to get all model's attributes as a plain Ruby Hash ? Calling either #attributes or #raw_attributes returns Moped::BSON::Document . While it actually extends Hash , several hash method does not work as expected. Particularly #except returns unmodified self , not hash with given keys stripped off . Update : Moped::BSON::Document properly inherits behavior of Hash . I was trying to name attributes with symbols, not strings, that's why #except didn't work. Shortly: do