jpstrikesback
jpstrikesback

Reputation: 2308

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

Upvotes: 2

Views: 2144

Answers (2)

speajus
speajus

Reputation: 93

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.

Upvotes: 1

Ali Sabil
Ali Sabil

Reputation: 60

There is an issue open about this: https://github.com/LearnBoost/mongoose/issues#issue/188

Upvotes: 3

Related Questions