vibedstruct2mongo ~master
Mongo pooler for use with vibe.d
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
import vibe.vibe;
import vibedstruct2mongo;
import struct2mongo;
MongoDBConnection mongoPool;
shared static this()
{
mongoPool = new MongoDBConnection("mongodb://localhost", 2);
auto settings = new HTTPServerSettings;
settings.port = 8089;
settings.bindAddresses = ["::1", "127.0.0.1"];
listenHTTP(settings, &hello);
logInfo("Please open http://127.0.0.1:8080/ in your browser.");
runApplication();
}
void hello(HTTPServerRequest req, HTTPServerResponse res)
{
res.writeBody("Hello, World!");
auto col = Col (mongoPool[`newBase`][`newCollection`]);
struct Example {
int a = 0;
}
col.insert(Example(5));
}
- Registered by Christian Durán C
- ~master released 6 years ago
- dedupely/vibe.d-struct2mongo-pooler
- MIT
- Copyright © 2018, Christian Durán C
- Authors:
- Dependencies:
- vibe-d, struct2mongo, vibe-d:tls, mondo
- Versions:
-
0.1.0 2018-Jan-29 ~master 2018-Jan-29 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
13 downloads total
-
- Score:
- 0.0
- Short URL:
- vibedstruct2mongo.dub.pm