An open API service indexing awesome lists of open source software.

https://github.com/webfreak001/mongostore

vibe.d component for storing sessions in MongoDB
https://github.com/webfreak001/mongostore

Last synced: 6 months ago
JSON representation

vibe.d component for storing sessions in MongoDB

Awesome Lists containing this project

README

          

# MongoStore
SessionStore for MongoDB

## Usage

```d
auto database = connectMongoDB("localhost").getDatabase("database");

auto settings = new HTTPServerSettings;
settings.sessionStore = new MongoSessionStore(database);

// In request:

auto session = req.session ? req.session : res.startSession();
session.set("user", Bson(["username": Bson("foo"), "email": Bson("bar@example.com")]));
logInfo("%s", session.get!Bson("user")); // [username: "foo", email: "bar@example.com"]
```