I'm testing a little bit with mongoDB. I've created a database with a high amount of data (approx 5 million documents). When I start a query for a non existing key, it will take a lot of time. I've tried to stop the query but db.curre开发者_JS百科ntOp() doesn't show a operation so I don't know how to stop the query.
Cheers Sven
You can try $maxScan
operator to limit items scanned:
db.foo.find()._addSpecial( "$maxScan" , 50 )
http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-Specialoperators
精彩评论