123456789_123456789_123456789_123456789_123456789_

Module: Mongo::Collection::Helpers Private

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/mongo/collection/helpers.rb

Overview

This module contains helper methods collection class.

Since:

  • 2.0.0

Instance Method Summary

Instance Method Details

#do_drop(operation, session, context) ⇒ Result

Executes drop operation and and ignores NamespaceNotFound error.

Parameters:

Returns:

  • (Result)

    The result of the execution.

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/collection/helpers.rb', line 31

def do_drop(operation, session, context)
  operation.execute(next_primary(nil, session), context: context)
rescue Error::OperationFailure::Family => ex
  # NamespaceNotFound
  if ex.code == 26 || ex.code.nil? && ex.message =~ /ns not found/
    false
  else
    raise
  end
end