if $and operator is not supported, do it at application level. This is the way out. You may have to get data in two or three queries and then 'AND' them on app level.
0
As you can use $or but can't use $and, you can split the first query group (totally 3 groups) like this:
db.test.find({ $or : [ { A : { $gt : x }, $or : [ { B : { $gt : m } }, { B : { $lt : n } } ] }, { A : { $lt : y }, $or : [ { B : { $gt : m } }, { B : { $lt : n } } ] } ], C : z });