2016-12-14 42 views
0

我有一個地理空間查詢像Follwing查詢。這個查詢返回4條記錄..我想幀PHP如何在PHP中編寫Mongo Geospatial查詢?

db.master.find({ location: 
    { $geoWithin: 
     { $centerSphere: [ [ 94.60867254, 27.54018825 ], 10/6378.1 ] } } }) 

以下查詢如何框上方的查詢在PHP?並得到結果?

回答

0

您應該檢查蒙戈文檔PHP herehere

+0

'$查詢=陣列( '位置'=> \t \t \t \t陣列( 「\ $ geoWithin」=> \t \t \t \t \t \t陣列( 「\ $ centerSphere」=>數組($長,$ LAT),5/6378.1) \t \t \t \t) );'這是正確的嗎? @Eric –

+0

真的很快它看起來不錯,你有什麼錯誤嗎? – Eric

+0

沒有埃裏克我得到的結果,沒有得到錯誤.. –