I tried to put following query together, but it is not working:
db.sss.find({
\"pos\": { \"$gte\": 200000, \"$lt\": 2000000 },
\"$where\": \"(this.chr.le
I assume that you have a problem with your $where logic. The way you described it:
(this.chr.letter != "X" && this.chr.no == 5) &&
(this.chr.letter != "X" && this.chr.no == 6) &&
(this.chr.letter != this.chr.letter)
Will return you nothing because this.chr.no can no be 5 and 6 at the same time. Most probably you wanted to have || in between of your brackets.