Convert sql to mongodb syntax