
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
botkit-storage-mongo
Advanced tools
A Mongo storage module for Botkit that provides a simple
system for storing information about a user, a channel, or a team.
This project is an extension to Botkit Core, a richly featured developer toolkit for building bots and conversational apps.
This module conforms to Botkit's storage plugin convention.
Just require botkit-storage-mongo and pass it a config with a mongoUri option. In addition, you may pass a tables parameter, which will create methods for accessing additional tables (other than user, channel and team) in your Mongo database.
Then pass the returned storage when creating your Botkit controller. Botkit will do the rest.
Make sure everything you store has an id property, that's what you'll use to look it up later.
var Botkit = require('botkit'),
mongoStorage = require('botkit-storage-mongo')({mongoUri: '...', tables: ['optional','list', 'of', 'custom','tables', 'to', 'add']}),
controller = Botkit.slackbot({
storage: mongoStorage
});
// then you can use the Botkit storage api, make sure you have an id property
var beans = {id: 'cool', beans: ['pinto', 'garbanzo']};
controller.storage.teams.save(beans);
controller.storage.teams.get('cool', function(error, beans){
// do something with beans
});
You can also get all entries from a table or find a selected set depending on a parameters.
storage.users.all(function(error, users){
// do something with users
});
storage.users.find({team_id: team_id}, function(error, users){
// do something with users
});
As of 1.0.6, all functions also support Promise syntax:
storage.users.all().then(function(list_of_users) {
// do something
});
FAQs
A MongoDB storage driver for Botkit
The npm package botkit-storage-mongo receives a total of 92 weekly downloads. As such, botkit-storage-mongo popularity was classified as not popular.
We found that botkit-storage-mongo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.