Select * from table_name where sport_type LIKE ('Cricket','Football');
我試圖找到與板球和足球的sport_type
文件find
貓鼬發現有多個值,使用領域
table.find({ sport_type : "Cricket" })
誰能幫我這樣做
Select * from table_name where sport_type LIKE ('Cricket','Football');
我試圖找到與板球和足球的sport_type
文件find
貓鼬發現有多個值,使用領域
table.find({ sport_type : "Cricket" })
誰能幫我這樣做
嘗試使用$or
:
table.find({ $or:[ {'sport_type':'Cricket'}, {'sport_type':'Football'} ]},
function(err,docs){
// do something
});
您的回答相當於'Select * from table_name where sport_type ='Cricket'or sport_type ='Football';'。他尋找一個「LIKE」比較。 – Mitchapp
@Mitchapp OP正在嘗試使用「Cricket」或「Football」的「sport_type」來查找文檔。我不認爲他在尋找一種模式。 –
在您的SQL示例中是否有一個原因是您使用'LI KE'而不是'IN'? – JohnnyHK