crcn/beanpoll-mongo — Issue #3: ability to map schemas to routes
Author: crcn
Created: 2012-03-03 22:22:52+00:00
State: open

55a5ee724f5280bd7bc9b4ec02000004|d7b2982565c5ea4aa3f101b564d47bd1

```javascript
var Comments = new Schema({
title : String
, body : String
, date : Date
});

var BlogPost = new Schema({
author : ObjectId
, title : String
, body : String
, buf : Buffer
, date : Date
, comments : [Comments]
, meta : {
votes : Number
, favs : Number
}
});

//would map to:
//posts/:post/comments/:comment
router.pull('mongodb/map', { posts: BlogPost }, function(err, result) {

//ability to extend a given route
router.on({
/**
*/

'pull posts/:post/comments/:comment/+': function() {
//do stuff here
this.next();
}
});
});
```