def rename(to_name)
      begin
        session.
          with(database: "admin", read: :primary).
          command(renameCollection: "#{database.name}.#{name}", to: "#{database.name}.#{to_name}")
      rescue Moped::Errors::OperationFailure => e
        raise e unless e.ns_not_exists?
        false
      end
    end
def rename(to_name)
      begin
        session.
          with(database: "admin", read: :primary).
          command(renameCollection: "#{database.name}.#{name}", to: "#{database.name}.#{to_name}")
      rescue Moped::Errors::OperationFailure => e
        raise e unless e.ns_not_exists?
        false
      end
    end
Rename the collection

 @example Rename the collection to 'foo'
   collection.rename('foo')

 @return [ Hash ] The command information.

 @since 2.0.0