Mongodb的geoNear只能按距离排序,请问如果需要按创建日期排序,解决方法有哪些!
深圳万兴 2015-03-27 04:30:02 db.runCommand(
{
geoNear : "Infos" ,
near : { "type" : "Point" , "coordinates" : [113.643196,34.800495]} ,
spherical : true ,
minDistance: 0,
maxDistance: 5000,
num : 50
})
像上面的查询,只能按距离排序,如果需要按日期排序,该怎么做,就像陌陌的附近的人一样,距离 + 上线时间