-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.2.0
-
Component/s: None
-
None
By mongo-ruby-driver, How to detect the cursor_not_found?
as moped…
lib/moped/protocol/get_more.rb def failure_exception(reply) if reply.cursor_not_found? Errors::CursorNotFound.new(self, cursor_id) else Errors::QueryFailure.new(self, reply.documents.first) end end
By the following monkey patch, Can't detected the cursor_not_found.
module Mongo module Protocol class Reply def cursor_not_found? flags.include?(:cursor_not_found) end end end end module Mongo class Cursor def fail_cursor_not_found if @initial_result.replies.last && @initial_result.replies.last.cursor_not_found? fail Mongo::Error::OperationFailure end end def more? fail_cursor_not_found @cursor_id != 0 end end end