On Wed, 02 Nov 2016 00:55:55 GMT, Uiy Uiy wrote:

If I try to connect to a mongoDB in a static this, it fails.

I suppose that vibe.d has not initialized the mongoDB driver.

It simplifies my code to initialize module level global database variables in static this but this is non-compliant with vibe.d. While I could spawn a thread and spin for a bit until vibe.d has run, this is not the optimal solution.

MongoClient client;
MongoDatabase db;
MongoCollection collection;
static this()
{
	client = connectMongoDB("127.0.0.1");
	db = client.getDatabase("Test");	
	collection = client.getCollection("Test.test");
}

Any ideas?

I just tried this locally and it worked for me for the latest master version of vibe.d. Which version are you using and what error exactly occurs?