Registry / database / mongo-store

mongo-store

JSON →
library0.0.2jsnpmunverified

Session store backed by MongoDB, designed for use with Express/Connect session middleware. Version 0.0.2 is the latest and only release; no active maintenance since 2013. Key differentiator: minimalistic API but relies on outdated mongo-col and is not a direct replacement for connect-mongo. Not suitable for modern Node.js or MongoDB drivers.

npm install mongo-store
INSTALL
IMPORT
SIG · MONGO-STORE
M
mongo-store
databasejavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mongoStore
import mongoStore from 'mongo-store'
const mongoStore = require('mongo-store')
ESM import; CJS require works but is legacy
default (function)
import createStore from 'mongo-store'
import { mongoStore } from 'mongo-store'
The default export is a factory function; named import is not available

Initializes a MongoDB session store using mongo-col library, sets and retrieves a session.

import mongoStore from 'mongo-store'; import mongoCol from 'mongo-col'; mongoCol('my-sessions', async (collection) => { const store = mongoStore(collection); store.set('user1', { name: 'Alice' }, (err) => { if (err) console.error(err); store.get('user1', (err, value) => { if (err) console.error(err); console.log(value); }); }); });
Debug
Known issues
breakingDepends on mongo-col which is no longer maintained and incompatible with modern MongoDB drivers.
fix
Migrate to connect-mongo or session-file-store for stable session storage.
affects: >=0.0.0
breakingPackage has no TypeScript typings; all types are implicit any.
fix
Create a declaration file or use a typed session store like connect-mongo.
affects: >=0.0.0
deprecatedThe entire package is effectively deprecated; last release in 2013, no bug fixes or updates.
fix
Replace with connect-mongo or another actively maintained session store.
affects: >=0.0.0
gotchaThe store expects a MongoDB collection object from mongo-col, not a native MongoDB driver collection.
fix
Use mongo-col wrapper or adapt the collection interface.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'mongo-col'
mongo-col is not installed or deprecated.
fix
Run npm install mongo-col or switch to connect-mongo.
TypeError: mongoStore is not a function
Import style mismatch (named import vs default).
fix
Use import mongoStore from 'mongo-store' or const mongoStore = require('mongo-store').
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mongo-store — npm install mongo-store · libregistry