You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: document.rb
    path of file: ./repos/rsolr/lib/rsolr
    
    the code of the file until where you have to start completion: module RSolr
  class Document
    CHILD_DOCUMENT_KEY = '_childDocuments_'.freeze
    ATOMIC_MULTI_VALUE_OPERATIONS = %i[set add add-distinct remove]

    # "attrs" is a hash for setting the "doc" xml attri
    
    def add_field(name, values, options = {})
      RSolr::Array.wrap(values).each do |v|
        field_attrs = { name: name }
        field_attrs[:type] = DocumentField if name.to_s == CHILD_DOCUMENT_KEY

        @fields << RSolr::Field.instance(options.merge(field_attrs), v)
      end
    end