Description

SessionStore for MongoDB

Package Information

Version1.1.0 (2016-May-01)
Repository https://github.com/WebFreak001/MongoStore
Licensepublic domain
CopyrightCopyright © 2016, webfreak
Authorswebfreak
Registered byWebFreak
Dependencies

vibe-d

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

MongoStore

SessionStore for MongoDB

Usage

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"]

Available versions

1.1.0 1.0.0 ~master