0
我有一個基本的領域,其中包括興趣,位置座標 我需要用一個特定的用戶ID進行POST請求到得到結果的用戶模式查詢/查找MongoDB的文件與一系列的多個條件
app.post('api/users/search/:id',function(err,docs)
{ //find all the documents whose search is enabled.
//on documents returned in above find the documents who have atleast 3 common interests(req.body.interests) with the user with ':id'
// -----OR-----
//find the documents who stay within 'req.body.distance' compared to location of user with':id'
//Something like this
return User
.find({isBuddyEnabled:true}),
.find({"interests":{"$all":req.body.interests}}),
.find({"_id":req.params.id},geoLib.distance([[req.body.gcordinates],[]))
});
基本上我需要執行發現裏面找到或內部查詢查詢..