# File lib/mongo/collection.rb, line 618 def find_and_modify(opts={}) cmd = BSON::OrderedHash.new cmd[:findandmodify] = @name cmd.merge!(opts) cmd[:sort] = Mongo::Support.format_order_clause(opts[:sort]) if opts[:sort] @db.command(cmd)['value'] end