Tools to parse and validate a MongoDB URI.
Validates a host string
Returns a 2-tuple of host followed by port where port is default_port if it wasn’t specified in the string.
Parameters : |
|
---|
Validates an IPv6 literal host:port string.
Returns a 2-tuple of IPv6 literal followed by port where port is default_port if it wasn’t specified in entity.
Parameters : |
|
---|
Parse and validate a MongoDB URI.
Returns a dict of the form:
{
'nodelist': <list of (host, port) tuples>,
'username': <username> or None,
'password': <password> or None,
'database': <database name> or None,
'collection': <collection name> or None,
'options': <dict of MongoDB URI options>
}
Parameters : |
|
---|
Changed in version 3.1: warn added so invalid options can be ignored.
Validates the format of user information in a MongoDB URI. Reserved characters like ‘:’, ‘/’, ‘+’ and ‘@’ must be escaped following RFC 2396.
Returns a 2-tuple containing the unescaped username followed by the unescaped password.
Paramaters : |
|
---|
Changed in version 2.2: Now uses urllib.unquote_plus so + characters must be escaped.
Takes a string of the form host1[:port],host2[:port]... and splits it into (host, port) tuples. If [:port] isn’t present the default_port is used.
Returns a set of 2-tuples containing the host name (or IP) followed by port number.
Parameters : |
|
---|
Takes the options portion of a MongoDB URI, validates each option and returns the options in a dictionary.
Parameters : |
|
---|
Validates and normalizes options passed in a MongoDB URI.
Returns a new dictionary of validated and normalized options. If warn is False then errors will be thrown for invalid options, otherwise they will be ignored and a warning will be issued.
Parameters : |
|
---|