a middleware for connect to query mongodb by http get request