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)

Readme

Keywords

none

Package Sidebar

Install

npm i maprest

Weekly Downloads

1

Version

0.0.0

License

none

Last publish

Collaborators

  • architectd
  • crcn