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.
我们正在使用 Kadira 来尝试确定为什么我们的 Meteor 应用程序有时运行缓慢。您可以在图片中看到 find 操作很快,而 fetch 花了将近 7 秒。我知道这是一个悬而未决的问题,但有人知道是什么原因造成的吗?
该find命令将返回一个游标,它是指向数据库中对象的指针,同时fetch将包含所有对象的数组直接返回到您的浏览器。
find
fetch
看来您正在检索很多对象,因为 6 秒是很多时间。我建议你检查一下你是否真的需要获取太多对象,因为用户可能不会在一个屏幕上看到所有数据。
可能你本地的 MongoDB 中已经有了数据,可以分块查询。(使用limitMongoDB 中的约束)。
limit