I need to make a query like this in MongoDB:
db.collection.find( { $where : "(this.type & some_num) ^ some_num == 0"} )
Some_num is a variable and can be any integer.
I read the document here that says the Javascript query is slowing down and also cannot use the index and requires a table scan.
What is the alternative to the above query?
source
share