Following the examples at: http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/query-builder-api.html
I have:
$dm = $this->get('doctrine.odm.mongodb.document_manager');
$query = $dm->createQueryBuilder('MainClassifiedBundle:Listing')->field('residentialOrCommercial')->equals($residentialOrCommercial);
if ($propertyType != 'All Property Types')
{
$query->field('propertyType')->equals($propertyType);
}
$query->field('askingPrice')->range($minPrice, $maxPrice)->field('coordinates')->geoNear((float)$longitude, (float)$latitude)->spherical(true);
if($radius!=0)
{
$query->maxDistance($radius);
}
$classifieds = $query->limit(5)->skip(2)->getQuery()->execute();
Everything works fine however the skip field makes no difference whatsoever. No matter if I put 1 or 1000, I am getting the same result set.
What am I missing?
UPDATE: I also tested this on another document collection and found out that it works. Something about the geoNear is what is messing up skip for me.