translate SQL query to mongodb query