请问我用mongoose的话,想用where a_ids in aArray 或者 b_ids in bArray 或者c_ids in cArray,我刚用$where试了下失败了,代码如下,希望帮忙看看怎么整比较好。
var line = "";
if(uids.length > 0){
line += "createby.uid in [" + uids + "]";
}
if(gids.length > 0){
line += " || createby.gid in [" + gids + "]";
}
if(tids.length > 0){
line += " || createby.tid in [" + tids + "]";
}
message.find({}).$where(line).setOptions(optionObj).exec(function(err, messages){
callback_(err, messages);
});