Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6541665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:07:56+00:00 2026-05-25T11:07:56+00:00

i have installed mongodb (1.8.3) on two seperate servers and set them up to

  • 0

i have installed mongodb (1.8.3) on two seperate servers and set them up to use “replica sets” as found here: http://www.mongodb.org/display/DOCS/Replica+Set+Tutorial

everything looks good so far: one server is recognized as primary, one as secondary (when i access them via commandline).

the problem is that i can’t connect to the DB using node.js (0.4.10) and mongoose (2.1.0) like this:

var mongo = require('mongoose');
mongo.connectSet('mongodb://host/dbname,mongodb://host2/dbname');

i always get the following error message:

TypeError: Cannot read property 'reconnectWait' of undefined
    at new <anonymous> (/var/www/node/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connections/repl_set_servers.js:23:31)
    at NativeConnection.doOpenSet (/var/www/node/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:80:18)
    at NativeConnection.openSet (/var/www/node/node_modules/mongoose/lib/connection.js:252:8)
    at Mongoose.connectSet (/var/www/node/node_modules/mongoose/lib/index.js:116:27)
...

searched around a bit and found a post somewhere saying that i also have to supply the name of the replica set – so i tried this instead:

mongo.connectSet('mongodb://host/dbname,mongodb://host2/dbname', rs_name:"name_replicaset"});

what am i doing wrong here …?!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:07:56+00:00Added an answer on May 25, 2026 at 11:07 am

    ok, there was an error in the https://github.com/christkv/node-mongodb-native module. it’s fixed now but not yet pushed to NPM. so for all you guys getting the same error, here is the fix:

    https://github.com/christkv/node-mongodb-native/pull/340

    after that, you can just say

    var mongo = require('mongoose');
    mongo.connectSet('mongodb://host:27018/testdb, host2:27017/testdb, host3:27019/testdb', function (err) {
      if (err) {
        console.log("could not connect to DB: " + err);
      }
    });
    mongo.connection.on('open', function () {
      console.log("mongodb connection open");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following the directions here: http://symfony.com/doc/2.0/bundles/DoctrineMongoDBBundle/index.html I have installed deps: #deps [doctrine-mongodb] git=http://github.com/doctrine/mongodb.git [doctrine-mongodb-odm]
I've been trying to use Mongoid with Rails on Ubuntu. I have installed mongoDB
I have installed RockMongo http://code.google.com/p/rock-php/ to manage my mongoDB database. This is installed in
I have installed TFS Power Tools and I am trying to use the powershell
I have installed a servlet (solr) that requires that I set the variable solr.solr.home
I just installed mongodb from Synaptic (Using ubuntu 11.10). I'm following this tutorial: http://howtonode.org/express-mongodb
I'm running node.js on OSX and have just installed mongodb using command npm install
I have just installed MongoDB in my machine (Windows 7) and installed node-mongodb-native using
I have successfully installed and run mongodb on my macbook pro with the c++
Folks, I have a question about MongoDB , is the following, MongoDB installed in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.