title: Node Express mssql returns json format without serializer and name of object
body: <p>I'm using Node express for the back-end of my application to retrieve data from a MSSQL database. I want to approach this server by another application, made with Ember. Ember DS does not know how to deal with the format returned by MSSQL.</p>
  
  <p>Format returned by MSSQL is in the form: </p>
  
  <pre><code>[{  
      "var1": "abc",
      "var2": "def",
      "var3": 3
  { 
      ... 
  }]
  </code></pre>
  
  <p>And, if understood correctly, should be in the form of:</p>
  
  <pre><code>{
      'modelName': [{     
          "_id": 1
          "var1": "abc",
          "var2": "def",
          "var3": 3
      },
      { 
          ... 
      }]
  }
  </code></pre>
  
  <p>Hence, it misses both the name of the record (modelName) and an ID/Serial. I want to fix this within the Express server and not in the serializer of the Ember application. I can't find how to modify the JSON output of MSSQL within Express to the one Ember understands.</p>
  
  <p>API endpoint looks like this:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  
  app.use(function(req, res, next) {
      res.setHeader('Access-Control-Allow-Origin', 'http://localhost:4200');
      res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
      res.header('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE, OPTIONS');
      next();
  });
  
  app.get('/api/data', function (req, res) {
  
    var sql = require("mssql");
  
    // config for your database
    var config = {
      user: 'user',
      password: 'pass',
      server: 'mssql-server',
      database: 'db'
    };
  
    // connect to your database
    sql.connect(config, function (err) {
  
      if (err) console.log(err);
  
      // create Request object
      var request = new sql.Request();
  
      // query to the database and get the records
      request.query('SELECT * [dbo].[table]',
        function (err, recordset) {
          if (err) console.log(err)
  
          // send records as a response
          res.send(recordset);
  
      });
    });
  });
  
  var server = app.listen(8080, function () {
    console.log('Server is running on localhost:8080...');
  });
  </code></pre>
  
  <p>Help would be highly appreciated!</p>
  
  <p>I'm using (and be have to stick to) MSSQL 14.</p>