开发者

ExpressJS & Mongoose Schema embedding with DBRef examples

开发者 https://www.devze.com 2023-02-13 04:19 出处:网络
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:开发者_运维百科

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消