title: Can't use mongo based session store
body: <p>I have a mongoose and connect-mongo module instance in ym app. I am using the connect-mongo module to have a session store persisted in a mongodb database (mongohq) instead of a memory store.</p>
  
  <p>Everytime I try to access my app when the server is launched (facebook auth with everyauth) I get the following: </p>
  
  <blockquote>
    <p>500 MongoError: Error: unauthorized db:express-sessions lock type:-1
    client:199.192.242.4</p>
  </blockquote>
  
  <p>My user name, password are good. </p>
  
  <pre><code>var conf = {
    db: {
      db: 'express-sessions',
      host: 'staff.mongohq.com',
      port: 10072,  // optional, default: 27017
      username: 'admin', // optional
      password: 'admin', // optional
      collection: 'facebookSessions' // optional, default: sessions
    },
    secret: '076ee61d63aa10a125ea872411e433b9'
  };
  
  app.use(express.session({
      secret: conf.secret,
      maxAge: new Date(Date.now() + 3600000),
      store: new MongoStore(conf.db)
    }));
  </code></pre>
  
  <p>Edit, this seems to be an issue with my mongohq. I modified the collection for an older one and it works.</p>