improved query

improved the query for mongoDB