0
我從我的帆API查詢我的Postgres數據庫:直到我進入第二個查詢帆查詢保持渲染未定義的對象
Foot.query("SELECT id FROM foot WHERE foot.date <'"+nowMinus3d+"' AND date >'"+nowMinus4d+"'", function(err, results){
_.each(results.rows, function(result, err){
console.log(result["id"]);
Player.query("SELECT player.user FROM player WHERE (player.statut = 2 OR player.statut = 3) AND player.foot ='"+results.rows["id"]+"'", function(err, players){
console.log(players);
})
})
})
},
一切正常:Player.query
,在這裏我不斷收到未定義console.log(players)
。我在Pgadmin接口中測試了這個查詢,並且我認爲我應該在[{user:2},{user:1}]的某處爲players
獲得一個對象。 我在這裏做錯了什麼?
謝謝我沒有注意到,什麼是「IN」? –
MYSQL IN:類似於 SELECT player.user FROM玩家WHERE(player.statut = 2或player.statut = 3)AND player.foot in(x,y,z) – Ming