Converts a JavaScript expression to a MongoDB query object