Looping JSON to get matching values from Database

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












I have a need to take in a payload that looks like this:




"Registry":[
"Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"1",
"Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"2",
"Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"3"
]



Read each record and remove the "@!!!@" and then search the database for the value (represented by xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx). This is web api 2.0. The return payload should look like this:




"Registry": [
"ProcessId": "1",
"Code": 200,
"Value": "Test",
"Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
,

"ProcessId": "2",
"Code": 404,
"Message": "Could not resolve token.",
"Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
,

"ProcessId": "3",
"Code": 200,
"Message": "Test2",
"Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]



If a "process id" is provided return that same number with the return record if not provided return a unique process id "counter".



I have a service that is handling this on an exposed API controller and it seems to work rather quickly but I feel as if it is written poorly. This is what I have so far:



 [Route("get")]
[HttpPost]
public async Task<HttpResponseMessage> GetPIIRegistry([FromBody] JObject registryArry)

ReturnCodes.UsedCodes = new List<int>();
JArray registryArray = null;
registryArray = (JArray)registryArry["Registry"];
var payloadTokens = registryArray.Values("Token");
int processIdCounter = 1;
HttpResponseMessage response;
List<string> values = new List<string>();

foreach (var item in payloadTokens)

values.Add(item.ToString().Contains("@!!!@") ? item.ToString().Replace("@!!!@", "") : item.ToString());


List<REGISTRY> returnVals = new List<REGISTRY>();
using (var dataContext = new registryEntries())

dataContext.Configuration.AutoDetectChangesEnabled = false;

var query =
from registries in dataContext.REGISTRies
where values.Contains(registries.Token)
select registries;
returnVals = query.ToList();


JArray returnObjects = new JArray();
foreach (JObject registryObj in registryArray)

var returnObj = new JObject();
var resultSet = returnVals.Where("Token.Equals(@0)", registryObj["Token"].ToString().Replace("@!!!@",""));
if (resultSet.Count() > 0)

foreach (var item in resultSet)

returnObj = new JObject();
if(registryObj["ProcessId"] != null)

if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

returnObj["ProcessId"] = processIdCounter.ToString();

else

returnObj["ProcessId"] = registryObj["ProcessId"];


else

returnObj["ProcessId"] = processIdCounter.ToString();


if (item.Remote == 0)

returnObj["Code"] = ReturnCodes.OK;
returnObj["Value"] = item.Value;
returnObj["Token"] = "@!!!@" + item.Token;
returnObj["Remote"] = item.Remote;
if(!ReturnCodes.UsedCodes.Contains(ReturnCodes.OK)) ReturnCodes.UsedCodes.Add(ReturnCodes.OK);

else

//remote get not enabled
returnObj["Code"] = ReturnCodes.NotFound;
returnObj["Message"] = "Remote service not implemented. No matching values found.";
returnObj["Token"] = "@!!!@"+item.Token;
if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);

returnObjects.Add(returnObj);


else

if (registryObj["ProcessId"] != null)

if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

returnObj["ProcessId"] = processIdCounter.ToString();


else

returnObj["ProcessId"] = registryObj["ProcessId"];


else

returnObj["ProcessId"] = processIdCounter.ToString();

returnObj["Code"] = ReturnCodes.NotFound;
returnObj["Message"] = "Provided token produced no matches.";
returnObj["Token"] = "@!!!@"+registryObj["Token"].ToString().Replace("@!!!@","");
returnObjects.Add(returnObj);
if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);


processIdCounter++;

var returns = returnObjects.ToString();
returns = "Registry:" + returns + "";
var json = JObject.Parse(returns);

if (ReturnCodes.UsedCodes.Count() > 1)

response = Request.CreateResponse((HttpStatusCode)ReturnCodes.MultiStatus, json);

else

try

response = Request.CreateResponse((HttpStatusCode)200, json);

catch

response = Request.CreateResponse((HttpStatusCode)ReturnCodes.Error, json);



return response;



Any thoughts on how to clean this up?







share|improve this question

























    up vote
    2
    down vote

    favorite












    I have a need to take in a payload that looks like this:




    "Registry":[
    "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"1",
    "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"2",
    "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"3"
    ]



    Read each record and remove the "@!!!@" and then search the database for the value (represented by xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx). This is web api 2.0. The return payload should look like this:




    "Registry": [
    "ProcessId": "1",
    "Code": 200,
    "Value": "Test",
    "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ,

    "ProcessId": "2",
    "Code": 404,
    "Message": "Could not resolve token.",
    "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ,

    "ProcessId": "3",
    "Code": 200,
    "Message": "Test2",
    "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ]



    If a "process id" is provided return that same number with the return record if not provided return a unique process id "counter".



    I have a service that is handling this on an exposed API controller and it seems to work rather quickly but I feel as if it is written poorly. This is what I have so far:



     [Route("get")]
    [HttpPost]
    public async Task<HttpResponseMessage> GetPIIRegistry([FromBody] JObject registryArry)

    ReturnCodes.UsedCodes = new List<int>();
    JArray registryArray = null;
    registryArray = (JArray)registryArry["Registry"];
    var payloadTokens = registryArray.Values("Token");
    int processIdCounter = 1;
    HttpResponseMessage response;
    List<string> values = new List<string>();

    foreach (var item in payloadTokens)

    values.Add(item.ToString().Contains("@!!!@") ? item.ToString().Replace("@!!!@", "") : item.ToString());


    List<REGISTRY> returnVals = new List<REGISTRY>();
    using (var dataContext = new registryEntries())

    dataContext.Configuration.AutoDetectChangesEnabled = false;

    var query =
    from registries in dataContext.REGISTRies
    where values.Contains(registries.Token)
    select registries;
    returnVals = query.ToList();


    JArray returnObjects = new JArray();
    foreach (JObject registryObj in registryArray)

    var returnObj = new JObject();
    var resultSet = returnVals.Where("Token.Equals(@0)", registryObj["Token"].ToString().Replace("@!!!@",""));
    if (resultSet.Count() > 0)

    foreach (var item in resultSet)

    returnObj = new JObject();
    if(registryObj["ProcessId"] != null)

    if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

    returnObj["ProcessId"] = processIdCounter.ToString();

    else

    returnObj["ProcessId"] = registryObj["ProcessId"];


    else

    returnObj["ProcessId"] = processIdCounter.ToString();


    if (item.Remote == 0)

    returnObj["Code"] = ReturnCodes.OK;
    returnObj["Value"] = item.Value;
    returnObj["Token"] = "@!!!@" + item.Token;
    returnObj["Remote"] = item.Remote;
    if(!ReturnCodes.UsedCodes.Contains(ReturnCodes.OK)) ReturnCodes.UsedCodes.Add(ReturnCodes.OK);

    else

    //remote get not enabled
    returnObj["Code"] = ReturnCodes.NotFound;
    returnObj["Message"] = "Remote service not implemented. No matching values found.";
    returnObj["Token"] = "@!!!@"+item.Token;
    if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);

    returnObjects.Add(returnObj);


    else

    if (registryObj["ProcessId"] != null)

    if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

    returnObj["ProcessId"] = processIdCounter.ToString();


    else

    returnObj["ProcessId"] = registryObj["ProcessId"];


    else

    returnObj["ProcessId"] = processIdCounter.ToString();

    returnObj["Code"] = ReturnCodes.NotFound;
    returnObj["Message"] = "Provided token produced no matches.";
    returnObj["Token"] = "@!!!@"+registryObj["Token"].ToString().Replace("@!!!@","");
    returnObjects.Add(returnObj);
    if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);


    processIdCounter++;

    var returns = returnObjects.ToString();
    returns = "Registry:" + returns + "";
    var json = JObject.Parse(returns);

    if (ReturnCodes.UsedCodes.Count() > 1)

    response = Request.CreateResponse((HttpStatusCode)ReturnCodes.MultiStatus, json);

    else

    try

    response = Request.CreateResponse((HttpStatusCode)200, json);

    catch

    response = Request.CreateResponse((HttpStatusCode)ReturnCodes.Error, json);



    return response;



    Any thoughts on how to clean this up?







    share|improve this question





















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I have a need to take in a payload that looks like this:




      "Registry":[
      "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"1",
      "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"2",
      "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"3"
      ]



      Read each record and remove the "@!!!@" and then search the database for the value (represented by xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx). This is web api 2.0. The return payload should look like this:




      "Registry": [
      "ProcessId": "1",
      "Code": 200,
      "Value": "Test",
      "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      ,

      "ProcessId": "2",
      "Code": 404,
      "Message": "Could not resolve token.",
      "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      ,

      "ProcessId": "3",
      "Code": 200,
      "Message": "Test2",
      "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      ]



      If a "process id" is provided return that same number with the return record if not provided return a unique process id "counter".



      I have a service that is handling this on an exposed API controller and it seems to work rather quickly but I feel as if it is written poorly. This is what I have so far:



       [Route("get")]
      [HttpPost]
      public async Task<HttpResponseMessage> GetPIIRegistry([FromBody] JObject registryArry)

      ReturnCodes.UsedCodes = new List<int>();
      JArray registryArray = null;
      registryArray = (JArray)registryArry["Registry"];
      var payloadTokens = registryArray.Values("Token");
      int processIdCounter = 1;
      HttpResponseMessage response;
      List<string> values = new List<string>();

      foreach (var item in payloadTokens)

      values.Add(item.ToString().Contains("@!!!@") ? item.ToString().Replace("@!!!@", "") : item.ToString());


      List<REGISTRY> returnVals = new List<REGISTRY>();
      using (var dataContext = new registryEntries())

      dataContext.Configuration.AutoDetectChangesEnabled = false;

      var query =
      from registries in dataContext.REGISTRies
      where values.Contains(registries.Token)
      select registries;
      returnVals = query.ToList();


      JArray returnObjects = new JArray();
      foreach (JObject registryObj in registryArray)

      var returnObj = new JObject();
      var resultSet = returnVals.Where("Token.Equals(@0)", registryObj["Token"].ToString().Replace("@!!!@",""));
      if (resultSet.Count() > 0)

      foreach (var item in resultSet)

      returnObj = new JObject();
      if(registryObj["ProcessId"] != null)

      if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

      returnObj["ProcessId"] = processIdCounter.ToString();

      else

      returnObj["ProcessId"] = registryObj["ProcessId"];


      else

      returnObj["ProcessId"] = processIdCounter.ToString();


      if (item.Remote == 0)

      returnObj["Code"] = ReturnCodes.OK;
      returnObj["Value"] = item.Value;
      returnObj["Token"] = "@!!!@" + item.Token;
      returnObj["Remote"] = item.Remote;
      if(!ReturnCodes.UsedCodes.Contains(ReturnCodes.OK)) ReturnCodes.UsedCodes.Add(ReturnCodes.OK);

      else

      //remote get not enabled
      returnObj["Code"] = ReturnCodes.NotFound;
      returnObj["Message"] = "Remote service not implemented. No matching values found.";
      returnObj["Token"] = "@!!!@"+item.Token;
      if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);

      returnObjects.Add(returnObj);


      else

      if (registryObj["ProcessId"] != null)

      if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

      returnObj["ProcessId"] = processIdCounter.ToString();


      else

      returnObj["ProcessId"] = registryObj["ProcessId"];


      else

      returnObj["ProcessId"] = processIdCounter.ToString();

      returnObj["Code"] = ReturnCodes.NotFound;
      returnObj["Message"] = "Provided token produced no matches.";
      returnObj["Token"] = "@!!!@"+registryObj["Token"].ToString().Replace("@!!!@","");
      returnObjects.Add(returnObj);
      if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);


      processIdCounter++;

      var returns = returnObjects.ToString();
      returns = "Registry:" + returns + "";
      var json = JObject.Parse(returns);

      if (ReturnCodes.UsedCodes.Count() > 1)

      response = Request.CreateResponse((HttpStatusCode)ReturnCodes.MultiStatus, json);

      else

      try

      response = Request.CreateResponse((HttpStatusCode)200, json);

      catch

      response = Request.CreateResponse((HttpStatusCode)ReturnCodes.Error, json);



      return response;



      Any thoughts on how to clean this up?







      share|improve this question











      I have a need to take in a payload that looks like this:




      "Registry":[
      "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"1",
      "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"2",
      "Token":"@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","ProcessId":"3"
      ]



      Read each record and remove the "@!!!@" and then search the database for the value (represented by xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx). This is web api 2.0. The return payload should look like this:




      "Registry": [
      "ProcessId": "1",
      "Code": 200,
      "Value": "Test",
      "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      ,

      "ProcessId": "2",
      "Code": 404,
      "Message": "Could not resolve token.",
      "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      ,

      "ProcessId": "3",
      "Code": 200,
      "Message": "Test2",
      "Token": "@!!!@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      ]



      If a "process id" is provided return that same number with the return record if not provided return a unique process id "counter".



      I have a service that is handling this on an exposed API controller and it seems to work rather quickly but I feel as if it is written poorly. This is what I have so far:



       [Route("get")]
      [HttpPost]
      public async Task<HttpResponseMessage> GetPIIRegistry([FromBody] JObject registryArry)

      ReturnCodes.UsedCodes = new List<int>();
      JArray registryArray = null;
      registryArray = (JArray)registryArry["Registry"];
      var payloadTokens = registryArray.Values("Token");
      int processIdCounter = 1;
      HttpResponseMessage response;
      List<string> values = new List<string>();

      foreach (var item in payloadTokens)

      values.Add(item.ToString().Contains("@!!!@") ? item.ToString().Replace("@!!!@", "") : item.ToString());


      List<REGISTRY> returnVals = new List<REGISTRY>();
      using (var dataContext = new registryEntries())

      dataContext.Configuration.AutoDetectChangesEnabled = false;

      var query =
      from registries in dataContext.REGISTRies
      where values.Contains(registries.Token)
      select registries;
      returnVals = query.ToList();


      JArray returnObjects = new JArray();
      foreach (JObject registryObj in registryArray)

      var returnObj = new JObject();
      var resultSet = returnVals.Where("Token.Equals(@0)", registryObj["Token"].ToString().Replace("@!!!@",""));
      if (resultSet.Count() > 0)

      foreach (var item in resultSet)

      returnObj = new JObject();
      if(registryObj["ProcessId"] != null)

      if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

      returnObj["ProcessId"] = processIdCounter.ToString();

      else

      returnObj["ProcessId"] = registryObj["ProcessId"];


      else

      returnObj["ProcessId"] = processIdCounter.ToString();


      if (item.Remote == 0)

      returnObj["Code"] = ReturnCodes.OK;
      returnObj["Value"] = item.Value;
      returnObj["Token"] = "@!!!@" + item.Token;
      returnObj["Remote"] = item.Remote;
      if(!ReturnCodes.UsedCodes.Contains(ReturnCodes.OK)) ReturnCodes.UsedCodes.Add(ReturnCodes.OK);

      else

      //remote get not enabled
      returnObj["Code"] = ReturnCodes.NotFound;
      returnObj["Message"] = "Remote service not implemented. No matching values found.";
      returnObj["Token"] = "@!!!@"+item.Token;
      if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);

      returnObjects.Add(returnObj);


      else

      if (registryObj["ProcessId"] != null)

      if (string.IsNullOrEmpty(registryObj["ProcessId"].ToString()))

      returnObj["ProcessId"] = processIdCounter.ToString();


      else

      returnObj["ProcessId"] = registryObj["ProcessId"];


      else

      returnObj["ProcessId"] = processIdCounter.ToString();

      returnObj["Code"] = ReturnCodes.NotFound;
      returnObj["Message"] = "Provided token produced no matches.";
      returnObj["Token"] = "@!!!@"+registryObj["Token"].ToString().Replace("@!!!@","");
      returnObjects.Add(returnObj);
      if (!ReturnCodes.UsedCodes.Contains(ReturnCodes.NotFound)) ReturnCodes.UsedCodes.Add(ReturnCodes.NotFound);


      processIdCounter++;

      var returns = returnObjects.ToString();
      returns = "Registry:" + returns + "";
      var json = JObject.Parse(returns);

      if (ReturnCodes.UsedCodes.Count() > 1)

      response = Request.CreateResponse((HttpStatusCode)ReturnCodes.MultiStatus, json);

      else

      try

      response = Request.CreateResponse((HttpStatusCode)200, json);

      catch

      response = Request.CreateResponse((HttpStatusCode)ReturnCodes.Error, json);



      return response;



      Any thoughts on how to clean this up?









      share|improve this question










      share|improve this question




      share|improve this question









      asked Aug 2 at 19:13









      VinnyGuitara

      12911




      12911

























          active

          oldest

          votes











          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "196"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f200851%2flooping-json-to-get-matching-values-from-database%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f200851%2flooping-json-to-get-matching-values-from-database%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Python Lists

          Aion

          JavaScript Array Iteration Methods