我在我的rails应用程序中有一个mongo查询,因为该集合非常庞大.
FbCheckin.where(ext_fb_place_id: self.ext_fb_place_id).all
Run Code Online (Sandbox Code Playgroud)
我从文档中读到,您可以添加一个timeout选项,以防止光标超时,并显示以下消息:
Moped::Errors::CursorNotFound: The operation: "GET MORE" failed with error
Run Code Online (Sandbox Code Playgroud)
我尝试了几种方法,包括
FbCheckin.where(ext_fb_place_id: ext_fb_place_id, {:timeout=>false}).all
Run Code Online (Sandbox Code Playgroud)
和
FbCheckin.find(ext_fb_place_id: ext_fb_place_id, {:timeout=>false}).all
Run Code Online (Sandbox Code Playgroud)
但这些都不会阻止光标超时.
有谁知道我怎么能做这个查询并收集所有FbCheckins没有光标超时事先?
谢谢