lib/mongo/db.rb
# Returns the error message from the most recently executed database
# operation for this connection, or +nil+ if there was no error.
#
# Note: as of this writing, errors are only detected on the db server
# for certain kinds of operations (writes). The plan is to change this
# so that all operations will set the error if needed.
Returns the error message from the most recently executed database
operation for this connection, or +nil+ if there was no error.

as of this writing, errors are only detected on the db server
for certain kinds of operations (writes). The plan is to change this
so that all operations will set the error if needed.
Returns the error message from the most recently executed database operation for this connection or + nil + if there was no error . as of this writing errors are only detected on the db server for certain kinds of operations ( writes ) . The plan is to change this so that all operations will set the error if needed .
def error
          doc = db_command(:getlasterror => 1)
          raise "error retrieving last error: #{doc}" unless ok?(doc)
          doc['err']
        end
def error doc = db_command ( :getlasterror => 1 ) raise "error retrieving last error: #{doc}" unless ok? ( doc ) doc [ 'err' ] end
Returns the error message from the most recently executed database
operation for this connection, or +nil+ if there was no error.
Returns the error message from the most recently executed database operation for this connection or + nil + if there was no error .