vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function parseMongoDBUrl

Parses the given string as a mongodb URL. The URL must be in the form documented at http://www.mongodb.org/display/DOCS/Connections which is:

bool parseMongoDBUrl (
  out MongoClientSettings cfg,
  string url
) @safe;

mongodb

//[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

Returns

true if the URL was successfully parsed. False if the URL can not be parsed.

If the URL is successfully parsed the MongoClientSettings instance will contain the parsed config. If the URL is not successfully parsed the information in the MongoClientSettings instance may be incomplete and should not be used.

Authors

Sönke Ludwig

Copyright

© 2012-2016 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.