ExpressJS & Mongoose Schema embedding with DBRef examples
I'd love to collect/see any code examples or links to such using ExpressJS & Mongoose that show Schema embedding, saving/updating with DBRefs. Simple usecase:
开发者_运维百科Comments on a Blog Post with DBRefs to Users in the Blog Post and Each Comment, showing saving/updating, and maybe as an extra treat: getters, setters, and a virtual or 2 tallying total comments or something
There is an issue open about this: https://github.com/LearnBoost/mongoose/issues#issue/188
You may want to look at https://github.com/jspears/mojaba and https://github.com/jspears/mers
Mers exposes Mongoose Schema as JSON/REST in the expressjs framework and Mojaba creates CRUD operations for mongoose schemas. I am working on making mojaba an express plugin so all you have to do is add your schema and you get a fully functioning crud thing, but that's not quite done yet.
Its a little rough but should work.
精彩评论