Comments (12)
I encountered a similar issue with the same error and the same solution.
from connect-mongodb.
+1
from connect-mongodb.
+1
Problem persistent in [email protected]
from connect-mongodb.
+1
from connect-mongodb.
How do you force mongodb to verstion 1.3.4? I am working with someone's example and having this error. I don't see where I can make this change. In which file of my app? An d what exactly should the line be? Thank you in advance.
from connect-mongodb.
The mongodb folder in the node_modules folder is what's used by the app. Typically the node_modules folder is populated by running the "npm install" command, which reads the dependencies from a file called package.json.
Assuming you're following this typical dependency-management style, modify your package.json so that the version of mongodb depended on is set to "1.3.4" (rather than "~1.3.x" or "1.3.5"), then run "npm install."
For more information on npm, see this (somewhat-dated) series of Nodejitsu blog posts.
from connect-mongodb.
Oops, didn't mean to click "Close & Comment".
from connect-mongodb.
Thank you for your answer, Airandfingers, but my package.json doesn't have mongodb in it. Below is the contents of the package file. Meanwhile though, I somewhat fixed the issue by changing my express.session lines of code to this:
var MongoStore = require('connect-mongo')(express);
app.use(express.session({
store: new MongoStore({
url: process.env.MONGOLAB_URI
}),
secret: process.env.COOKIEHASH
}));
Here is my package.json file:
{
"name": "dwd-nodejs-passportjs",
"version": "0.0.1",
"dependencies": {
"express": "3.x",
"hogan-express" : "0.3.3",
"mongoose" : "3.5.4",
"moment" : "1.7.2",
"passport": "0.1.x",
"consolidate": "latest",
"ejs" : "latest",
"passport-local": "0.1.x",
"passport-local-mongoose": "0.2.0",
"connect-mongo" : "0.3.x",
"aws-sdk" : "v0.9.8-pre.9"
},
"engines" : {
"node" : "0.8.x",
"npm" : "1.1.x"
}
}
from connect-mongodb.
Hm, it looks like you're using connect-mongo instead of connect-mongodb. That's a mistake I've seen a few times in this repo's issues (I sometimes get confused, myself.)
Here's an excerpt from my code, for reference:
var MongoStore = require('connect-mongodb') //used as our session store
, mongodb = require('mongodb')
, db = new mongodb.Db(db_config.DB_NAME, server_config, { w: -1 });
, session_store = new MongoStore({ db: db, username: 'user', password: 'password });
from connect-mongodb.
+1
Problem persistent in [email protected]
from connect-mongodb.
+1
Indeed still a problem in 1.3.8
from connect-mongodb.
The better work around is to just connect to your mongodb object before you pass it to conenct-mongodb.
I have raised an issue with mongodb API to fix this better.
from connect-mongodb.
Related Issues (20)
- Version bump of Connect for Node > v0.7.0 HOT 1
- bash ./install.sh HOT 2
- Why is the session stringified? HOT 1
- TypeError: Cannot call method 'findOne' of null at MongoStore.get HOT 11
- Using connect-mongodb on Windows HOT 6
- compatibility with connect 2.x ? HOT 5
- dependencies to mongodb 0.9.7 build failed on Win32 platform HOT 2
- Plans for 0.7.x/0.8.x branch? HOT 6
- trouble with req.sessionStore
- Cannot install: mongodb-1.0.2 no longer avaialble HOT 1
- looking for the 'sessions' collection
- connect-mongodb not working with mongodb > 1.02
- Document whether to set `safe: true` or `false`
- Cannot call method 'findOne' of undefined
- TypeError: Cannot call method 'remove' of null when trying init connection
- Suggestion.
- License? HOT 3
- New Mongo driver demands 'default write concern' HOT 1
- New connect session storage with mongo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connect-mongodb.