title: Can't get data for req.body with mean stack
body: <p>Hey I can't seem to get any results whilst using the req.body. Trying to get out the data from my mongodbdatabase to json format Here is my code:</p>
  
  <p>My server file:</p>
  
  <pre><code>app.get('/api/category/posts', (req, res) =&gt; {
      Post.find({ categoryId: req.body._id }, function(err, posts) {
          res.json(posts);
      });
  });
  </code></pre>
  
  <p>Service file:</p>
  
  <pre><code>getPosts(_id): Observable&lt;Post[]&gt;{
              return this.http.get&lt;Post[]&gt;(this.apiUrl +"/category/posts");
                }
  </code></pre>
  
  <p>component.ts</p>
  
  <pre><code>this.appService.getPosts(_id)
      .subscribe(data =&gt;this.posts=data);
  </code></pre>