maprest

0.0.0 • Public • Published
 
//mongoose schema
 
var maprest = require('maprest');
 
var Comment = {
    title : String,
    body  : String,
    date  : Date
};
 
 
var BlogPost = {
    author   : ObjectId,
    title    : String,
    body     : String
};
 
 
 
//mapped to:
//posts/:post
//posts/:post/comments/:comment
var mapper = maprest({
    name: 'post',
    schema: BlogPost,
    methods: ['GET','POST','PUT']
    hasMany: {
        name: 'comment',
        schema: Comment
    }
});
 
 

Api

.transform.mongooseSchema(options)

Dependencies (5)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i maprest

    Weekly Downloads

    2

    Version

    0.0.0

    License

    none

    Last publish

    Collaborators

    • architectd
    • crcn