title: Query for remove object inside array using gte condition MonggoDB
body: <p>Hello I'm new to monggodb query, I'm trying to delete object inside my array using mongo3t query which is the date going forward from 2021-09-13.</p>
  <p>My current data is: attendance</p>
  <pre><code>{
      &quot;_id&quot;: {
          &quot;$oid&quot;: &quot;6070b991d6231f8c205cb093&quot;
      },
      &quot;UserId&quot;: &quot;5&quot;,
      &quot;Ranges&quot;: [
          {
              &quot;DateFrom&quot;: {
                  &quot;DateTime&quot;: {
                      &quot;$date&quot;: &quot;2021-09-12T00:00:00.000Z&quot;
                  },
                  &quot;Ticks&quot;: {
                      &quot;$numberLong&quot;: &quot;637536960000000000&quot;
                  }
              }
          },
          {
              &quot;DateFrom&quot;: {
                  &quot;DateTime&quot;: {
                      &quot;$date&quot;: &quot;2021-09-13T00:00:00.000Z&quot;
                  },
                  &quot;Ticks&quot;: {
                      &quot;$numberLong&quot;: &quot;637536960000000000&quot;
                  }
              }
          },
          {
              &quot;DateFrom&quot;: {
                  &quot;DateTime&quot;: {
                      &quot;$date&quot;: &quot;2021-09-15T00:00:00.000Z&quot;
                  },
                  &quot;Ticks&quot;: {
                      &quot;$numberLong&quot;: &quot;637536960000000000&quot;
                  }
              }
          }
      ]
  }
  </code></pre>
  <p>Here's the query I tried to execute,</p>
  <pre><code>db.getCollection('attendance').update(
      { UserId: &quot;5&quot; },
      { $pull: { 'Ranges': { DateFrom: { DateTime: { $gte: new Date(2021, 09, 13) } } } } }
  );
  </code></pre>
  <p>My query runs successfully with message &quot;Updated 1 existing record(s) in 4ms&quot;, but upon checking the data nothing happens.</p>