title: can't read sha256 from nested array within mongodb
body: <p>I have below structure of the mongoose collection.</p>
  
  <pre><code>const sha256 = require('crypto-js/sha256');
  
      var Temp = new Schema();
  
      Temp.add({
          item1: String,
          item2: String,
          data: [
              {
                  arrItem1: Number,
                  arrItem2: String
              }
          ],
          recurData: [Temp],
          currentHash: {
              type: String,
              default: ''
          },
          previousHash: {
              type: String,
              default: ''
          }
      });
  </code></pre>
  
  <p>I am calculating the currentHash value as below:</p>
  
  <pre><code>return sha256(this.item1 + JSON.stringify(this.data) + this.previousHash).toString();
  </code></pre>
  
  <p>So, the issue is when I try to read the currentHash value as below and I am getting the output as "undefined".</p>
  
  <pre><code>var Temp = new Temp({//Initialised the data});
  var latestDocument = Temp.recurData[Temp.RecurData.length - 1];
  console.log(latestDocument.currentHash);
  </code></pre>
  
  <p>Could someone please advise if it's an existing issue or am I doing something wrong ?</p>