title: How to create a field mapping in Azure Search with a complex targetField
body: <p>I use the Azure Search indexer to index documents from a MongoDB CosmosDB which contains objects with fields named <code>_id</code>. 
  As Azure Search does not allow underscores at the beginning of a field name in the index, I want to create a field mapping. </p>
  
  <p>JSON structure in Cosmos --> structure in index</p>
  
  <pre><code>{
    "id": "test"
    "name": "test",
    "productLine": {
       "_id": "123",       --&gt; "id": "123"
       "name": "test"
    }
  }
  </code></pre>
  
  <p>The <a href="https://docs.microsoft.com/en-us/azure/search/search-indexer-field-mappings#set-up-field-mappings" rel="noreferrer">documentation</a> has exactly this scenario as an example <strong>but</strong> only for a top level field. </p>
  
  <p><code>"fieldMappings" : [ { "sourceFieldName" : "_id", "targetFieldName" : "id" } ]}</code></p>
  
  <p>I tried the following:</p>
  
  <p><code>"fieldMappings" : [ { "sourceFieldName" : "productLine/_id", "targetFieldName" : "productLine/id" } ] }</code></p>
  
  <p>that results in an error stating:</p>
  
  <p><code>Value is not accepted. Valid values: "doc_id", "name", "productName".</code></p>
  
  <p><strong>What is the correct way to create a mapping for a target field that is a subfield?</strong></p>