title: Update Embedded Document Mongo Field Name
body: <p>I went through this link: <a href="https://stackoverflow.com/questions/42736234/how-to-rename-a-document-field-in-a-mongodb">How to rename a document field in a MongoDB?</a>, but its not working fine for me. I've Mongo Document like below. I am using <code>MongoDB server version: 4.0.3</code>.</p>
  
  <pre><code>{
      "_id" : ObjectId("5cb825e566135255e0bf38a4"),
      "firstName" : "John",
      "lastName" : "svc_user",
      .....
      .....
      "status" : "A",
      "effDate" : ISODate("2012-08-24T01:46:33.000Z"),
      "department" : [ 
          {
              "deptName" : "KG",
              ....
              ....
          }, 
          ...
          ....
          .....
      ],
      ...
      ...
      ...
  }
  </code></pre>
  
  <p>I executed the below query:</p>
  
  <pre><code>db.employee.update({}, {$rename:{"department.deptName":"department.departmentName"}}, false, true);
  </code></pre>
  
  <p>Error:
  cannot use the part (department of department.deptName) to traverse the element</p>