Hello!
I have map with hundreds of thousands photos on it. And, accordingly, has a collection of photos in Mongo.
But sometimes user (owner of the photo or admin) can deactivate photo, that it could be seen only by the owner and that it is not selected from database for all other.
For this case i have boolean field 'disabled' in photo's collection.
Therefore, for all public requests I use condition like this:
Photos.find( { "loc": { "$within": { "$box": [ [0, 0] , [3, 3] ] } } , "disabled": {$ne: true}} )
Disabled photos in base about 1%. That is because one percent of photos for the remaining 99% I have to use the condition of all queries.
How do you think, do I need to use the index on the field 'disabled'? Or for such case can be found more elegant solution?