title: Nested/threaded comments system - MongoDB and Java
body: <p>I am currently building a charity student support website, to help African students that want to apply to American Universities. I want to build a threaded comments system. I was planing on using MongoDB, (backend is all java). I'm fairly new to MongoDB and therefore it is taking me a while to absorb all the information. I have some questions for you:</p>
  
  <p>Does anyone know of any implementation out there that I can take a look at? I wanted to have this done by the end of the weekend.</p>
  
  <p>I was thinking of doing something like this:</p>
  
  <pre><code>conversation
  { 
    _id: BigInt, 
    entityID: BigInt, //reference to what is being commented
    comments:[
      status: String (approved, spam, removed),  
      UID: BigInt,  
      timestamp: date  
      commentText: String
      likeCount: int
      replies:[
        status: String (approved, spam, removed),  
        UID: BigInt,  
        timestamp: date  
        commentText: String
        likeCount: int
      ]
    ]
  }
  </code></pre>
  
  <p>Thanks a lot for the help,</p>