I know some JS but I'm new to Node.js. I know this is a very common error but I couldn't find the source of the error since I lack debugging skills in Node.js.
Here is my app.js : 

```
var index = require('./routes/index');
var users = require('./routes/userlist');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', index);
app.use('/userlist', users);

```

Here is my userlist.js : 

```
var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

module.exports = router;

```

Here is my index.js:

```
var express = require('express');
var router = express.Router();

router.get('/userlist', function(req, res) {
    var db = req.db;
    var collection = db.get('usercollection');
    console.log(collection);
    collection.find({},{},function(e,docs){
        res.render('userlist', {
            "userlist" : docs
        });
    });
});

```

Here is userlist view : 

```
extends layout

block content
    h1.
        User List
    ul
        each user, i in userlist
            li
                a(href="mailto:#{user.email}")= user.username

```

I appreciate if you tell me where the problem is or tell me how I can detect the problem. Thanks in advance.

**EDIT:**

In console I get this : 

```
GET /userlist 500 296.280 ms - 1501

```

**EDIT 2:**
It gives me the error at this line : 

```
var collection = db.get('usercollection');

```

**EDIT 3:**
In index.js, I see that 

```
router.get('/userlist', function(req, res) {
    var db = req.db;

```

`req.db` is undefined. Why is it undefined? Do you have any idea?