I have a mongo query in my rails app that is timing out because the collection is huge.
FbCheckin.where(ext_fb_place_id: self.ext_fb_place_id).all
I've read from documentation that you can add a timeout
option to prevent the cursor from timing out with the following message:
Moped::Errors::CursorNotFound: The operation: "GET MORE" failed with error
I've tried several ways including
FbCheckin.where(ext_fb_place_id: ext_fb_place_id, {:timeout=>false}).all
and
FbCheckin.find(ext_fb_place_id: ext_fb_place_id, {:timeout=>false}).all
but none of these prevent the cursor from timing out.
Does anyone know how I can make this query and gather all the FbCheckins
without the cursor timing out beforehand?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…