This is my \'usergroups\' data
{
\"_id\": {
\"$oid\": \"58f7537ec422895572e988a1\"
},
\"name\": \"aaa\",
\"groupname\": \"group north,gro
You can use the $in
operator:
Usergroup.findOne({
mobilenumber: 0509867865
},
function(err, usergroup) {
if (err) {
return handleError(res, err);
}
if (!usergroup) {
return res.status(404).send('Not Found');
}
console.log(usergroup.groupname);
//group north ,group south
Group.find({
groupname: { $in: usergroup.groupname.split(",") }
},
function(err, group) {
if (err) {
return handleError(res, err);
}
return res.json(group);
});
});