Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Mongoid 中为我的 Mongo 查询设置超时?我知道 Mongo 支持cursor.maxTimeMS()但在 Mongoid 文档中找不到它。
cursor.maxTimeMS()
从 Mongoid 6 开始,您可以使用如下内容:
Model.max_time_ms(5000).all