mardi 6 octobre 2020

Read JSON values by a specific term

I have multiple JSON files and all of them have a "matching_terms" value. Example below:

{
  "calendar": [
    {
      "id": "12345",
      "title": "Acme Proposal Meeting",
      "invitees": "dave, john, bob, carol",
      "matching_terms": ["dave", "john", "bob", "carol", "acme"],
      "date": "2019-01-10 10:00:00"
    },
    {
      "id": "12345",
      "title": "Acme Final Delivery Meeting",
      "invitees": "dave, john, bob, alice",
      "matching_terms": ["dave", "john", "bob", "alice", "acme"],
      "date": "2019-03-01 11:00:00"
    }
  ]
}

I am creating a search bar, when an input is received from the search bar it should go through all the JSON files and look in the matching_terms value if the given input is present in it or not. If it is present then we display that particular JSON block. I am using React to build it, till now I've created a search bar, what would be the next steps or things to follow.

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire