{"record":{"id":"2ae7a1b5fa7a1dec","repo":"mongodb/mongoid","slug":"no-database-provided-for-client-configuration","errorCode":null,"errorMessage":"No database provided for client configuration: :%{name}.","messagePattern":"No database provided for client configuration: :%(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::NoClientDatabase","httpStatus":null,"severity":"error","filePath":"lib/mongoid/config/validators/client.rb","lineNumber":43,"sourceCode":"            validate_client_uri(name, config)\n          end\n        end\n\n        private\n\n        # Validate that the client config has database.\n        #\n        # @api private\n        #\n        # @example Validate the client has database.\n        #   validator.validate_client_database(:default, {})\n        #\n        # @param [ String | Symbol ] name The config key.\n        # @param [ Hash ] config The configuration.\n        def validate_client_database(name, config)\n          return unless no_database_or_uri?(config)\n\n          raise Errors::NoClientDatabase.new(name, config)\n        end\n\n        # Validate that the client config has hosts.\n        #\n        # @api private\n        #\n        # @example Validate the client has hosts.\n        #   validator.validate_client_hosts(:default, {})\n        #\n        # @param [ String | Symbol ] name The config key.\n        # @param [ Hash ] config The configuration.\n        def validate_client_hosts(name, config)\n          return unless no_hosts_or_uri?(config)\n\n          raise Errors::NoClientHosts.new(name, config)\n        end\n\n        # Validate that not both a uri and standard options are provided for a","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/config/validators/client.rb#L25-L61","documentation":"Error \"No database provided for client configuration: :%{name}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/config/validators/client.rb:43 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"}