K
K
Kusmich2015-12-23 21:59:42
JavaScript
Kusmich, 2015-12-23 21:59:42

How to implement search by json?

There is a json like this:

[{
    "id": 242,
    "name": "Abdul Rahman Baba",
    "position": "Left-Back",
    "jerseyNumber": 6,
    "dateOfBirth": "1994-07-02",
    "nationality": "Ghana",
    "contractUntil": "2020-06-30",
    "marketValue": "10,000,000 €"
}, {
    "id": 435,
    "name": "Falcao",
    "position": "Centre Forward",
    "jerseyNumber": 9,
    "dateOfBirth": "1986-02-10",
    "nationality": "Colombia",
    "contractUntil": "2016-06-30",
    "marketValue": "35,000,000 €"
}, {
    "id": 1840,
    "name": "Asmir Begovic",
    "position": "Keeper",
    "jerseyNumber": 1,
    "dateOfBirth": "1987-06-20",
    "nationality": "Bosnia-Herzegovina",
    "contractUntil": "2019-06-30",
    "marketValue": "12,000,000 €"
}]


How can you implement a search for such json with the output of results? Perhaps there are some frame-works?

That is, it is of interest if the user types in the input: 12,000,000 € To display all the players with such a fee, or, for example, enter, enter the fee not to the end, for example, 12 then, by partial coincidence (all the players in whom the number 12 is found in the fee or date of birth), or enters Ghana then all players who are from Ghana will be displayed, or if they are partially entered like this: Gh , then all players in the description of which have GH are displayed.

Is there a framework for this? And is it worth using them or is there an easier way to solve this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
timfcsm, 2015-12-23
@timfcsm

there are frameworks

N
nozzy, 2015-12-23
@nozzy

I recommend searching with XPATH for JSON and XML:
defiantjs.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question