News for hackers. Stuff that matters.
Re:3 reasons to use MongoDB by rabidsnail on Thursday September 09, 2010 @01:10PM (#1676042)
In real life you would have a users collection and an events collection, and the events field of users would be an array of event ids.
Re:3 reasons to use MongoDB by angilly on Thursday September 09, 2010 @01:15PM (#1676063)
My first response was "not necessarily," but I'm gonna ratchet it up a notch to a flat out "you're wrong."

Storing event_ids as an array in the events field defeats the whole purpose of organizing your data into rich documents.

In real life, you very well could build something where the events info was built straight into the user record.

Re:3 reasons to use MongoDB by mathias_10gen on Thursday September 09, 2010 @03:06PM (#1676481)
Actually it would probably be best to reverse the relation and put user_id's in the event objects. Then you can do queries like this:

    db.events.find({hosted_by: MY_ID})
    db.events.find({invited: MY_ID}) // invited is an array of users
Re:3 reasons to use MongoDB by sv123 on Thursday September 09, 2010 @02:05PM (#1676232)
seems like a relational database to me...only without the ability to join?
Re:3 reasons to use MongoDB by kchodorow on Thursday September 09, 2010 @03:10PM (#1676500)
Sort of. MongoDB tried to keep a lot of the trimmings of a relational database, but remain scalable. Joins are handy, but don't scale well.