MongoDB storage plugin for wingbot.ai chatbot framework (v4.2.13). Provides persistent storage for chat states (with optimistic locking via findOneAndUpdate), bot tokens (webview JWT), conversation logs, bot configuration, attachment cache (Facebook), audit logs with signature chain, and notification/automation records. Requires mongodb driver >=6.0.0 (peer dependency) and Node.js >=14. Ships TypeScript type definitions. The library implements a pluggable storage interface for the wingbot ecosystem; each storage class takes a `mongodb.Db` instance and optional collection name. Active maintenance with monthly releases.
npm install wingbot-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates MongoDB connection and three storage instances (state, config, chat log). Demonstrates optimistic lock, state update, config save, and chat log entry.
Use db.collection('states').createIndex({ field: 1 }, options) instead.Upgrade Node.js to version 14 or later.
Use mongodb@^4.x. For mongodb@5+, upgrade to wingbot-mongodb@4.2.0+ which supports mongodb@5 and 6.
Always check the returned object; if null, retry the operation or use the id to fetch the document.
Only set `isCosmo: true` if you are using Azure Cosmos DB with MongoDB API.
npm install mongodb
Verify you are importing from 'wingbot-mongodb' and using version >=4.0.0.
Use getOrCreateAndLock to safely insert or update instead of direct insert.