title: Query doesn't consider date range passed in parameters
body: <p>I am testing my query with MongoDB, it works perfectly but when I want to return data within a date range I am choosing it return the same data when I tested it without a date range, so it means that doesn't consider the parameters of date time I have passed.</p>
  
  <p>I am working at Symfony4 , MongoDB project , so u can find here the code of my query in the ReactionRepository : </p>
  
  <pre><code>public function getCommonFans($pages, $users, $from, $to)
  {
  
     $builder = $this-&gt;dm-&gt;createAggregationBuilder(FbReaction::class);
     $builder
     -&gt;match()
     -&gt;field('fbPage')-&gt;in($pages);
     -&gt;field('fbUser')-&gt;in( $users)
     -&gt;field('created_time')-&gt;gte($from)
     -&gt;field('created_time')-&gt;lte($to);
  
       $result = $builder-&gt;execute()-&gt;toArray();
  
       }
  </code></pre>
  
  <p>An this is the controller : </p>
  
  <pre><code> public function getCommunFansByCompetitor (Request $request){
  
        $reactionRepository = $this-&gt;get('doctrine_mongodb')-&gt;getManager()
        -&gt;getRepository(FbReaction::class);
  
  
        $from=$to=null;
        try {
          if($request-&gt;query-&gt;get('from'))
            $from = new \DateTime($request-&gt;query-&gt;get('from'));
  
          if($request-&gt;query-&gt;get('from'))
            $to = new \DateTime($request-&gt;query-&gt;get('to'));
        } catch (\Exception $e) {
        }
  
  
        $listOfCompetitorsPages = $reactionRepository-&gt;getCompetitors();
  
  
        $listOfUsersOfCurrentPage = $reactionRepository-&gt;getFansOfCurrentPage();
  
  
        $result = $reactionRepository-&gt;getCommonFans( $listOfCompetitorsPages , $listOfUsersOfCurrentPage , $from, $to);
  
  
        $response= $this-&gt;get('jms_serializer')-&gt;serialize($result, 'json');
  
        return new Response($response);
  
    }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9B1CM.png" rel="nofollow noreferrer">this is the document i am working in </a></p>