title: Updating a field inside a firebase firestore doc without hand write the field key to update Angular
body: <p>How could i update a doc inside my firestore without precisely write in the code the field i want to update , cause already is reached through the form:
  .Lets say the HTML tag in Angular already brings both the key and the import(that one to be updated):</p>
  
  <pre><code>HTML Tags
         &lt;form [formGroup]="importNgForm" (submit)="addUniqueImport()"&gt;
              &lt;div class="modal-body"&gt;
                &lt;div class="form-group"&gt;
                  &lt;label for="key"&gt;&lt;/label&gt;
                  &lt;input disabled type="text" value='{{incomeSelected}}' name="key" class="form-control" formControlName="key" /&gt;
                 &lt;/div&gt;
  
                &lt;div class="form-group"&gt;
                  &lt;label for="import"&gt;Add amount&lt;/label&gt;
                  &lt;input type="number" name="import" class="form-control" formControlName="import" /&gt;
                 &lt;/div&gt;
               &lt;/div&gt;
  
               &lt;div class="modal-footer"&gt;
                &lt;button type="submit" class="btn btn-primary"&gt;Add&lt;/button&gt;
               &lt;/div&gt;
  ......more code
  </code></pre>
  
  <p>Then on my component for that html  :</p>
  
  <pre><code>some imports...
  
  export class UserSheetBalanceComponent implements OnInit {
  
  importNgForm: FormGroup;
  
   constructor(
      private service: Service,
      private amountBuilder:FormBuilder,
    ) {
      this.importNgForm = this.amountBuilder.group({
        key:new FormControl(),
        import:new FormControl(),
      });
    }
  
    addUniqueImport() {
      this.service.addingImport(this.importNgForm.value as addImport)
    }
  
  </code></pre>
  
  <p>and then finally on my service component i just try to pass the parameters the form brings :</p>
  
  <pre><code> addingImport(dataToPass: addImport) {
  
      const path = this.docCreator
        .collection('users')
        .doc(this.userdata.uid)
        .collection('Incomings')
        .doc(this.userdata.uid);=====&gt;Path reaching the doc to update
  </code></pre>
  
  <p>Until declaring the path to access that document where the field is.But then when try to refer the name of the field i want to update through the form (dataToPass.key) ,and the import  for this field im doing reference to (dataToPass.import) the error appears. </p>
  
  <pre><code>   path.update({dataToPass.key:dataToPass.import}) ====&gt;doesn't work
     }
  </code></pre>
  
  <p>The problem is in the key, let say i instead of accessing my form(dataToPass) i write directly the name of the field to update(some name),i does work</p>
  
  <pre><code>   path.update({some name:dataToPass.import}) ======&gt;does work
     }
  </code></pre>
  
  <p>so im wondering how could i access that field key without precisely write it , but dynamically, in order to update my import once the field on query matchs
  Thanks in advance!!!!</p>