2

I am new to mongodb,Lets say User can create many Events,where Each Event Belongs to only one User.So in Relational Database I created Events Table Where I store UserId who created the Event, with details about event , what's the best way to handle this relation in monogdb?

Hari
  • 1,545
  • 1
  • 22
  • 45
  • Possible duplicate of [How to organise a many to many relationship in MongoDB](http://stackoverflow.com/questions/4839881/how-to-organise-a-many-to-many-relationship-in-mongodb) – Harsha W Apr 03 '17 at 05:54
  • @HarshaW sorry for mistake i made in question, in events table where each row contain details about event and user who created the event,i didn't create any new table to store event and user id .whether the link which u have given me now is fine for this case?? – Hari Apr 03 '17 at 06:01

1 Answers1

3

In general, use embedded data models when: you have one-to-one or one-to-many model, more information you can find here.

cn007b
  • 16,596
  • 7
  • 59
  • 74