Re:MongoDB queries don’t always return all matching documents
by chris_wot on Wednesday June 08, 2016 @07:31AM
(#11861483)
You have a house with an array of rooms, and each room has a house with an array of rooms? Etc.
Unless that's a reference to a house in the room class, that is not in any way a good design. And if it is a reference, then you implement it like this:
House is a table
Room is a table that has a foreign key that references the House primary key.
Unless that's a reference to a house in the room class, that is not in any way a good design. And if it is a reference, then you implement it like this:
House is a table
Room is a table that has a foreign key that references the House primary key.
Can't get much simpler than that!