We have a query that looks like this:
db.surveyResponse.find({"surveyId" : "4f39a79601bfa841a2c06272",
"$nor" : [
{
"interviewStatus" : -99
},
{
"interviewStatus" : -50
},
{
"interviewStatus" : -60
}
]
}
)
We also have an index {surveyId:1, interviewStatus:1}
Somewhere I read that $nor will not use index, but $or will. Does this apply here? Would it be better to rewrite this query using $or? Are there other ways of improving performance of this query?
There are about 2 million documents in this table. InterviewStatus is an enumeration and is sparse (about 8 integers).
Thanks.