Docs HomeMongoDB Compass

Adjust Maximum Time for Query Operations调整查询操作的最长时间

The MAX TIME MS query bar option sets the cumulative time limit in milliseconds to process query bar operations. “MAX TIME MS”查询栏选项设置处理查询栏操作的累积时间限制(以毫秒为单位)。If the time limit is reached before the operation completes, Compass interrupts the operation.如果在操作完成之前达到时间限制,Compass会中断操作。

MaxTimeMS Option

The default MAX TIME MS value is 60000, or 60 seconds. 默认的MAX TIME MS值为60000,即60秒。Consider raising this value if you have a very large collection, or your operations are frequently timing out. 如果您有一个非常大的集合,或者您的操作经常超时,请考虑提高此值。You can also consider creating indexes to improve query performance.您还可以考虑创建索引以提高查询性能。

Set MAX TIME MS

  1. Click Options.单击“选项”。
  2. Adjust MAX TIME MS to the desired value in milliseconds.将“MAX TIME MS”调整为以毫秒为单位的所需值。

Learn More了解更多信息

To learn more about MAX TIME MS, see cursor.maxTimeMS() in the MongoDB manual.要了解有关“MAX TIME MS”的更多信息,请参阅MongoDB手册中的cursor.maxTimeMS()