Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Initially i suggest to create only UserDocument and embed all event related collection inside of user, in the future you will see if events will be big collection(more that mongodb limit 4mb) you will move it into separate collection. As for images look at mongodb <a href="http://www.mongodb.org/display/DOCS/GridFS+Specification" rel="nofollow">gridFs</a> feature, it allow you to store file with any size. In user document you could store only collection of fileId.</p> <p>When you start to design document databe schema always start from embedding evething, later you will see what you need move into separate collection. In you case if you will need for example show list of all events you can't do it easy, because you need to load each user and get embeded collection of events, in such situation need to move events in separate collection.</p> <p><strong>Update:</strong></p> <p>Because you need to refernce to the event from any user document, you need to move event into separate collection, because it's always bad to reference to the embedded collections.</p> <p>So after disscussions with myself, seems to me that following scheme should fit you need:</p> <pre><code>UserDocument Collection -UserId -Type -Details -Events(EventId) -AppliedEvents -AttendingEvents -Files(it's not actual files it just references to gridFs filess) EventDocument Collection -EventId -EventDetail -FollowingUsers </code></pre> <p>I've moved almost all into UserDocument, because User is a 'strong' entity and you will work with user more than with event(it seems so for me).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload