title: mongoose not added it in same object
body: <p>I have data in this structure:</p>
  <pre><code>{
      &quot;_id&quot;: &quot;5f212467b57c1e693fd89060&quot;,
      &quot;location&quot;:
          {
              &quot;coordinates&quot;: [-31.802758, 115.837737],
              &quot;type&quot;: &quot;Point&quot;
          },
      &quot;store&quot;: &quot;Liberty Landsdale&quot;,
      &quot;__v&quot;: 0,
      &quot;getdata&quot;: [
          {
              &quot;2020-07-30&quot;:
                  {&quot;95&quot;: &quot;1.14&quot;}
          },
          {
              &quot;2020-07-30&quot;:
                  {&quot;91&quot;: &quot;1.02&quot;}
          }
      ]
  }
  </code></pre>
  <p>However I want it to look like this</p>
  <pre><code>{
      &quot;_id&quot;: &quot;5f212467b57c1e693fd89060&quot;,
      &quot;location&quot;: {
          &quot;coordinates&quot;: [-31.802758, 115.837737],
          &quot;type&quot;: &quot;Point&quot;
      },
      &quot;store&quot;: &quot;Liberty Landsdale&quot;,
      &quot;__v&quot;: 0,
      &quot;getdata&quot;: [
          {
              &quot;2020-07-30&quot;:
                  [
                   {&quot;95&quot;: &quot;1.14&quot;},
                   {&quot;91&quot;: &quot;1.02&quot;}
                  ]
          }
      ]
  }
  </code></pre>
  <p>I know the problem is the way I am inserting it into mongodb</p>
  <pre><code>mFuel.findOneAndUpdate(
      {'store': t, 'location': [{coordinates: [lat, long], type: &quot;Point&quot;}]},
      {$addToSet: {'getdata': {[d]: {[ftype]: p}}}}, {upsert: true}, 
      function (err) {
          if (err) {
              console.log('ERROR when submitting round');
              console.log(err);
          }
      });
  </code></pre>
  <p>I have tried <code>$push</code> as well as <code>set</code> and <code>addToSet</code></p>
  <p>I am wondering what is the correct way to achieve what am trying to do?</p>