On this page
$maxScan
$maxScan
Note
从 v3.2 开始在
mongo
Shell 中弃用从 v3.2 开始,$maxScan运算符在mongo shell 中已弃用。在mongoShell 中,改用cursor.maxScan()。
约束查询以仅在满足查询时扫描指定数量的文档。使用以下形式之一:
db.collection.find( { <query> } )._addSpecial( "$maxScan" , <number> )
db.collection.find( { $query: { <query> }, $maxScan: <number> } )
使用此修饰符可以防止可能长时间运行的查询通过扫描太多数据而破坏性能。