I recently posted this question: How to model a many self-referential relationship with many parents?
I got an adequate answer, but I was told that I could model this better using Mongo/Mongoid. I always wanted to attempt using a different database paradigm so maybe this will be a good start.
Is it true that this would be easier to model using Mongo? If so, could you help lay it out for me?
I basically have two options right? 1 is to create an array through a document that references Skill id’s through it? E.g, Skill.prerequisites = [Skill1, Skill2, Skill3]. Something that works with that structure right?
Otherwise it may be that I need to run something logical on that association so I’d have to create a separate model. This is where I get confused. Given I may need to create a separate model, does that exist as a document or an embedded document? What are my limitations w/ each strategy?
OK, so let’s go with your skill approach. Here’s how I’d model it in Mongoid:
With Mongo, this is the only way I would do it.
With ActiveRecord, you could: