Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mobylogix/botbuilder-mongoose-middleware
Middleware to store states in mongodb using mongoose
https://github.com/mobylogix/botbuilder-mongoose-middleware
botbuilder botbuilder-mongoose-middleware middleware mongodb mongoose
Last synced: about 3 hours ago
JSON representation
Middleware to store states in mongodb using mongoose
- Host: GitHub
- URL: https://github.com/mobylogix/botbuilder-mongoose-middleware
- Owner: mobylogix
- License: mit
- Created: 2018-01-08T08:41:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-22T09:58:35.000Z (almost 7 years ago)
- Last Synced: 2024-10-07T09:02:27.239Z (about 1 month ago)
- Topics: botbuilder, botbuilder-mongoose-middleware, middleware, mongodb, mongoose
- Language: JavaScript
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# botbuilder-mongoose-middleware
Middleware to store states in mongodb using mongoose### Install Package
```
npm i --save botbuilder-mongoose-middleware
``````javascript
import {IStorageClient} from 'botbuilder-mongoose-middleware';
import {AzureBotStorage} from 'azure-storage';mongoose.Promise = require('bluebird');
const dbPromise = mongoose.connect(process.env.MONGO_URL);dbPromise.then((db) => {
console.log("DB Connected..");
});const collectionName = "userData";
var docDbClient = new IStorageClient({db: dbPromise, collectionName}); //collection name is optional (default: userData)
var tableStorage = new AzureBotStorage({ gzipData: false }, docDbClient); //passing object to here
var bot = new builder.UniversalBot(connector).set('storage', tableStorage);//set your storage here
```