Select * from table_name where sport_type LIKE ('Cricket','Football');
I am trying to find the documents with sport_type
of Cricket and Football using find
table.find({ sport_type : "Cricket" })
Can anyone help me to do so
Select * from table_name where sport_type LIKE ('Cricket','Football');
I am trying to find the documents with sport_type
of Cricket and Football using find
table.find({ sport_type : "Cricket" })
Can anyone help me to do so
Try using $or
:
table.find( { $or:[ {'sport_type':'Cricket'}, {'sport_type':'Football'} ]},
function(err,docs){
// do something
});
Maybe it's too late to answer but hopefully it will help other people.
You can use $in
operator, like this:
mongoose.find({sport_type: {$in: ['Cricket', 'Football']}})
You provide an array to $in
operator and it will return all the documents which have an exact sport_type in the array specified.