translate sql query into mongodb query