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)