About MongoDB and many-to-many associations

Diego Peralta

Diego Peralta / almost 8 years ago

1 min read––– views

In a relational database, you might model a many-to-many relationship by creating a “join table.” MongoDB doesn’t have joins. But because arrays are first class citizens in MongoDB, you can simply store an array of ObjectId’s.

Subscribe to the newsletter

You can join here and I'll notify you whenever I publish a new post.

- subscribers – 1 issue