If I write a query and filter results using $where on an indexed field, will it use the index or will it scan into each document? For开发者_Python百科 example?:
function () { return this.indexed_field > 5 }
..and yes I'm well aware I could get away with using $gt in this particular instance =)
No, an index won't be used in that case. You can run an explain() to verify.
精彩评论