MongoDB regular expression with indexed field
I was creating my first app using MongoDB. Created index for a field, and tried a find query with $regex param, launched in a shell > db.foo.find({A:{$regex:'BLABLA!25500[0-9]'}}).explain() { "cursor" : "BtreeCursor A_1 multi", "nscanned" : 500001, "nscannedObjects" : 10, "n" : 10, "millis" : 956, "nYields" : 0, "nChunkSkips" : 0, "isMultiKey" : false, "indexOnly" : false, "indexBounds" : { "A" : [ [ "", { } ], [ /BLABLA!25500[0-9]/, /BLABLA!25500[0-9]/ ] ] } } It's very strange, because when i'm launching the same query, but with no index in collection, the performance is much better. > db