On Monday, April 8, 2013 11:07:02 AM UTC-4, jamieorc wrote:
They won't be the same EmbeddedDocument, so it doesn't quite make sense. Mongodb isn't a relational db, but you're putting a relational pattern on these collections. Perhaps rethink what you're trying to accomplish in the context of Mongodb as a document db?
Thanks for the feedback. I know Mongo doesn't excel at relational data. But in my case the proper model is relational (they are independent entities that can have some relation). It seems to me that MongoMapper tries to make up for Mongo's lightweight relational support (via belongs_to, many, etc.). Was hoping for something to support my models out the box. But since MongoMapper doesn't have it, no big deal. Just wrote a custom method and callback on the model to provide what I need.
This is essentially what I have. But instead of using a array of ID's I have an array of models to establish the relationship (since there is relevant info in the relationship itself).
Eric