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
- Host: GitHub
- URL: https://github.com/webfreak001/mongostore
- Owner: WebFreak001
- License: unlicense
- Created: 2015-10-31T13:17:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-11T07:30:48.000Z (about 9 years ago)
- Last Synced: 2025-01-11T04:13:16.692Z (over 1 year ago)
- Language: D
- Size: 3.91 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"]
```