开发者

Query for a non existing key in a big scale mongoDB database

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜