【发布时间】:2013-01-08 08:14:47
【问题描述】:
我有:
$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();
一切正常,但跳过字段没有任何区别。无论我输入 1 还是 1000,我都会得到相同的结果集。
我错过了什么?
更新:我还在另一个文档集合上进行了测试,发现它有效。对我来说,geoNear 的某些东西让我很困惑。
【问题讨论】:
标签: mongodb mongodb-php doctrine-mongodb