Class: Mongo::Operation::Find::Legacy::Result

Inherits:
Result
  • Object
show all
Includes:
Result::UseLegacyErrorParser
Defined in:
build/ruby-driver-master/lib/mongo/operation/find/legacy/result.rb

Overview

Defines custom behavior of results for a query.

Since:

  • 2.1.0

Constant Summary

Constants inherited from Result

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

Instance Attribute Summary

Attributes inherited from Result

#connection_description, #replies

Instance Method Summary collapse

Methods included from Result::UseLegacyErrorParser

#parser

Methods inherited from Result

#acknowledged?, #cluster_time, #cursor_id, #documents, #each, #error, #initialize, #inspect, #labels, #namespace, #ok?, #operation_time, #reply, #returned_count, #snapshot_timestamp, #topology_version, #validate!, #write_concern_error?, #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



39
40
41
# File 'build/ruby-driver-master/lib/mongo/operation/find/legacy/result.rb', line 39

def successful?
  !query_failure?
end