mongodb/mongoid · error · Mongoid::Errors::InvalidQueryExecutor

Invalid async_query_executor option: %{executor}.

Error message

Invalid async_query_executor option: %{executor}.

What it means

Error "Invalid async_query_executor option: %{executor}." thrown in mongodb/mongoid.

Source

Thrown at lib/mongoid/contextual/mongo/documents_loader.rb:67

        # Returns suitable executor according to Mongoid config options.
        #
        # @param [ String | Symbol] name The query executor name, can be either
        #   :immediate or :global_thread_pool. Defaulted to `async_query_executor`
        #   config option.
        #
        # @return [ Concurrent::ImmediateExecutor | Concurrent::ThreadPoolExecutor ] The executor
        #   to be used to execute document loading tasks.
        #
        # @raise [ Errors::InvalidQueryExecutor ] If an unknown name is provided.
        def self.executor(name = Mongoid.async_query_executor)
          case name.to_sym
          when :immediate
            immediate_executor
          when :global_thread_pool
            global_thread_pool_async_query_executor
          else
            raise Errors::InvalidQueryExecutor.new(name)
          end
        end

View on GitHub (pinned to 0da0e23d71)

When it happens

Trigger: Thrown at lib/mongoid/contextual/documents_loader.rb:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mongodb/mongoid@0da0e23d71 (2026-08-23). Data as JSON: /api/errors/3605ed2763da84a9. Report an issue: GitHub.