Giter Site home page Giter Site logo

Comments (12)

matt2000 avatar matt2000 commented on September 17, 2024

I encountered a similar issue with the same error and the same solution.

from connect-mongodb.

srour avatar srour commented on September 17, 2024

+1

from connect-mongodb.

vihang avatar vihang commented on September 17, 2024

+1

Problem persistent in [email protected]

from connect-mongodb.

troyth avatar troyth commented on September 17, 2024

+1

from connect-mongodb.

olgmik avatar olgmik commented on September 17, 2024

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.

airandfingers avatar airandfingers commented on September 17, 2024

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.

airandfingers avatar airandfingers commented on September 17, 2024

Oops, didn't mean to click "Close & Comment".

from connect-mongodb.

olgmik avatar olgmik commented on September 17, 2024

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.

airandfingers avatar airandfingers commented on September 17, 2024

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.

linhuiw avatar linhuiw commented on September 17, 2024

+1

Problem persistent in [email protected]

from connect-mongodb.

mfloryan avatar mfloryan commented on September 17, 2024

+1

Indeed still a problem in 1.3.8

from connect-mongodb.

polidore avatar polidore commented on September 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.