title: POST request returning [Object, object]
body: <p>I am trying to send a POST request (using postman) to create an entry in my PostgreSQL database. However, currently my POST request is returning [object, Object], and I cannot figure out why.</p>
  
  <p>Here is the code to handle the request.</p>
  
  <pre><code>//enable the router
  app.use('/', router);
  
  //Create 
  router.post('/api/v1/todos', (req, res, next) =&gt; {
    const results = [];
    console.log("Congrats you hit the create function!!");
  
    //grab data from http-request, 'complete' is from a boolean value in the database
    const data = {text: req.query.text, complete: false };
  
    //give error if not recieving a request 
    if(!req.query.text) res.send(400, "The Request data is: " + req.query);
  
    //get a prostgres client from the connection pool
    pg.connect(connectionString, (err, client, done) =&gt; {
      //handle connection errors
      if (err) {
        done();
        console.log(err);
        return res.status(500).json({success: false, data: err});
      }
  
      //SQL Query -&gt; Insert Data
      client.query('INSERT INTO items(text, complete) values($1,$2)', 
      [data.text, data.complete]);
  
      //SQL Query -&gt; Select Data
      const query = client.query("SELECT * FROM items ORDER BY id ASC");
  
      //Stream results back one row at a time
      query.on('row', (row) =&gt; {
        results.push(row);
      });
  
      //After all data is returned, close connection and return the results
      query.on('end', () =&gt; {
        done();
        return res.json(results);
        //return res.json(data);
      });
    });
  });
  </code></pre>
  
  <p>And here is my POST
  <a href="https://i.stack.imgur.com/W6l1K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W6l1K.png" alt="POST image"></a></p>
  
  <p>Why is my data returning objects? What can I do in order to resolve this?</p>
  
  <p><a href="http://pastebin.com/zDz9YF9Q" rel="nofollow noreferrer">Here is my full code</a>. </p>