在mongodb中查找几何视图端口中的所有数据?

时间:2018-05-09 11:54:57

标签: mongodb geolocation mongodb-query geospatial

我正在尝试在viewport中获取所有数据

$qb = $this->createQueryBuilder('user');
return $qb->select('user, count(reservations) as count')
  ->leftJoin('user.reservations', 'reservations')
  ->leftJoin('reservations.marketDate', 'market_date')
  ->where('market_date.date >= CURRENT_DATE()')
  ->orderBy('user.name')
  ->groupBy('user.id')
  ->getQuery()
  ->getResult();

我收集的数据包含

等数据
"viewport": {
            "northeast": {
                "lat": -33.8652709197085,
                "lng": 151.1972016802915
            },
            "southwest": {
                "lat": -33.8679688802915,
                "lng": 151.1945037197085
            }
        }

我试着在mongodb上查询

{data:"Block 1", location: { "coordinates" : [ 77.58556519999999, 12.943470099999999 ], "type" : "Point" }}

但是我希望在rectange框架内的数据如何能够实现这一目标?

0 个答案:

没有答案