title: Implementing a blog with MongoDB and NoRM: Relationships?
body: <p>I'm starting to learn MongoDB, using the NoRM C# driver in an ASP.NET MVC project. I'm just writing POCO classes right now, and have question on how to implement relationships between <strong>Blog Posts</strong>, <strong>Comments</strong>, and <strong>Tags</strong>. I <strong><em>think</em></strong> I have the Post &amp; Comment, but not sure what to do on the Tags. In SQL, they are many-to-many relationship, how would I implements something similar with MongoDB &amp; NoRM?</p>
  
  <p>These are my classes for Post &amp; Comment:</p>
  
  <pre><code>public class Post
      {
          public ObjectId _id { get; set; }
          public string Title { get; set; }
          public string Post { get; set; }
          public string Uri { get; set; }
          public DateTime Date { get; set; }
      }
  
  public class Comment
      {
          public ObjectId _id { get; set; }
          public DbReference&lt;Post&gt; Post { get; set; }
          public string Comments { get; set; }
          public string Author { get; set; }
          public string Email { get; set; }
          public string Url { get; set; }
          public DateTime Date { get; set; }
      }
  </code></pre>
  
  <p>My Tag object is the one in question, how can I relate tags &lt;==> posts.</p>
  
  <pre><code>public class Tag
      {
          public ObjectId _id { get; set; }
          public string Name { get; set; }
      }
  </code></pre>
  
  <p>Thanks.</p>