mongodb/mongoid · error · Mongoid::Errors::NoClientDatabase
No database provided for client configuration: :%{name}.
Error message
No database provided for client configuration: :%{name}. What it means
Error "No database provided for client configuration: :%{name}." thrown in mongodb/mongoid.
Source
Thrown at lib/mongoid/config/validators/client.rb:43
validate_client_uri(name, config)
end
end
private
# Validate that the client config has database.
#
# @api private
#
# @example Validate the client has database.
# validator.validate_client_database(:default, {})
#
# @param [ String | Symbol ] name The config key.
# @param [ Hash ] config The configuration.
def validate_client_database(name, config)
return unless no_database_or_uri?(config)
raise Errors::NoClientDatabase.new(name, config)
end
# Validate that the client config has hosts.
#
# @api private
#
# @example Validate the client has hosts.
# validator.validate_client_hosts(:default, {})
#
# @param [ String | Symbol ] name The config key.
# @param [ Hash ] config The configuration.
def validate_client_hosts(name, config)
return unless no_hosts_or_uri?(config)
raise Errors::NoClientHosts.new(name, config)
end
# Validate that not both a uri and standard options are provided for aView on GitHub (pinned to 0da0e23d71)
When it happens
Trigger: Thrown at lib/mongoid/config/validators/client.rb:43 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/2ae7a1b5fa7a1dec.
Report an issue: GitHub.