Module: Mongo::Collection::Helpers Private

Included in:
Mongo::Collection, SearchIndex::View
Defined in:
lib/mongo/collection/helpers.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

This module contains helper methods collection class.

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#do_drop(operation, session, context) ⇒ Result

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Executes drop operation and ignores NamespaceNotFound error.

Parameters:

Returns:

  • (Result)

    The result of the execution.

Since:

  • 2.0.0



30
31
32
33
34
35
36
37
# File 'lib/mongo/collection/helpers.rb', line 30

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

  false
end