I want to get all the JSON objects having season:2008
or season:2009
. For season field there are 2008,2009,2010,2011,2012,2013,2014,2015,2016 values.
Now your both the routes are identical...you have to make different routes for both queries... because queries does not know what is match_id and session... if you keep same name for the routes then query which is before in the code will be executed first
change your both the routes
app.get('/api/match_id/:match_id)
app.get(/api/matches/:season)
Before http://localhost:5000/api/matches/2010 before the /api/matches/:season there should be a route name. Lets say your route name is match.js you the url would look like http://localhost:5000/match/api/matches/2010. Depends how you defined the index.js