{"record":{"id":"1b2a33ce180a55e2","repo":"mongodb/mongoid","slug":"no-configuration-could-be-found-for-a-client-named","errorCode":null,"errorMessage":"No configuration could be found for a client named '%{name}'.","messagePattern":"No configuration could be found for a client named '%(.+?)'\\.","errorType":"exception","errorClass":"Mongoid::Errors::NoClientConfig","httpStatus":null,"severity":"error","filePath":"lib/mongoid/clients/factory.rb","lineNumber":27,"sourceCode":"\n      # Create a new client given the named configuration. If no name is\n      # provided, return a new client with the default configuration. If a\n      # name is provided for which no configuration exists, an error will be\n      # raised.\n      #\n      # @example Create the client.\n      #   Factory.create(:analytics)\n      #\n      # @param [ String | Symbol ] name The named client configuration.\n      #\n      # @raise [ Errors::NoClientConfig ] If no config could be found.\n      #\n      # @return [ Mongo::Client ] The new client.\n      def create(name = nil)\n        return default unless name\n\n        config = Mongoid.clients[name]\n        raise Errors::NoClientConfig.new(name) unless config\n\n        create_client(config)\n      end\n\n      # Get the default client.\n      #\n      # @example Get the default client.\n      #   Factory.default\n      #\n      # @raise [ Errors::NoClientConfig ] If no default configuration is\n      #   found.\n      #\n      # @return [ Mongo::Client ] The default client.\n      def default\n        create_client(Mongoid.clients[:default])\n      end\n\n      private","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/clients/factory.rb#L9-L45","documentation":"Error \"No configuration could be found for a client named '%{name}'.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/clients/factory.rb:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}