Class: Mongo::Operation::Read::Query::Result

Inherits:
Mongo::Operation::Result show all
Defined in:
lib/mongo/operation/read/query/result.rb

Overview

Defines custom behaviour of results for a query.

Since:

  • 2.1.0

Constant Summary

Constants inherited from Mongo::Operation::Result

Mongo::Operation::Result::CURSOR, Mongo::Operation::Result::CURSOR_ID, Mongo::Operation::Result::FIRST_BATCH, Mongo::Operation::Result::N, Mongo::Operation::Result::NAMESPACE, Mongo::Operation::Result::NEXT_BATCH, Mongo::Operation::Result::OK, Mongo::Operation::Result::RESULT

Instance Attribute Summary

Attributes inherited from Mongo::Operation::Result

#replies

Instance Method Summary collapse

Methods inherited from Mongo::Operation::Result

#acknowledged?, #cursor_id, #documents, #each, #initialize, #inspect, #multiple?, #namespace, #ok?, #reply, #returned_count, #validate!, #written_count

Constructor Details

This class inherits a constructor from Mongo::Operation::Result

Instance Method Details

#successful?true, false

Determine if the query was a success.

Examples:

Was the query successful?

result.successful?

Returns:

  • (true, false)

    If the query was successful.

Since:

  • 2.0.0



33
34
35
# File 'lib/mongo/operation/read/query/result.rb', line 33

def successful?
  !query_failure?
end