title: How can i save json data in mongoose
body: <p>This is my json data I want to save it in a mongoose database but I am confused how to design my mongoose schema.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>data is { 'posts[0][commentId]': '0',
    'posts[0][id]': '1',
    'posts[0][postName]': 'hi',
    'posts[0][img]': '',
    'posts[0][postBy]': ' Neeraj',
    'posts[1][commentId]': '0',
    'posts[1][id]': '2',
    'posts[1][postName]': 'hii',
    'posts[1][img]': '',
    'posts[1][postBy]': ' Neeraj',
    'posts[1][comments][0][commentId]': '1',
    'posts[1][comments][0][commentValue]': 'hlo how are u???',
    'posts[1][comments][0][commentBy]': ' Neeraj',
    'posts[1][comments][0][upCounter]': '5',
    'posts[1][comments][0][downCounter]': '6' }</code></pre>
  </div>
  </div>
  </p>
  
  <p>this is my Post schema but i dont know how to actually design it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var postSchema=new Schema({
      posts:[{
           commentId:  Number ,
    
      comments : [{
        commentBy : String,
          commentId  : String,
          commentValue:String,
          date:Date,
          downCounter:Number,
          upCounter:Number
      }],
  id:String,
  img:String,
  postBy:String,
  postDate:Date,
  postName:String
  }]
  });</code></pre>
  </div>
  </div>
  </p>