dchester / epilogue

Create flexible REST endpoints and controllers from Sequelize models in your Express app
846 stars 116 forks source link

Implement a count route #112

Open xizhao opened 8 years ago

xizhao commented 8 years ago

something like /count/[modelname]?query would be really helpful! mongoose/mongodb has this

mbroadst commented 8 years ago

@xizhao hey that sounds like a cool idea, and would be pretty easy to implement. Unfortunately, I have very little time to dedicate towards new features for this project at the moment. If you wanted to give developing a shot, I would be quite happy to help you along and answer questions as they pop up. Maybe someone else lurking is interested in helping as well?

ThatCheck commented 8 years ago

Why not just with a HEAD Request? You have the pagination resource enabled by default. So just make a HEAD request on /yourentity and use the value of the "Content-Range" header.

I don't know if this fit your need or you really want count request.