Tuesday, 2 May 2017

API returns array of JSON for only one result

Currently working on an API which given an address returns information about is. Some of the rows in our tables are duplicates, however being as there is over 15 million I cant go and find the duplicates. Instead I have opted to use

    var query = `SELECT TOP 1 * from my_TABLE where..conditions`;

This ensures that only one row of the duplicates are returned. The problem is when this is sent back as a JSON it comes as an array with one object

[{
 Address:'our info'
}]

is there a way to have it respond with

{
 Address:'our info'
}



via Peter jamen

No comments:

Post a Comment