typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

[BUG] Multiple where clauses in Document DB #107

Closed zolotas4 closed 3 years ago

zolotas4 commented 3 years ago

Describe the bug

We are not able to apply more than one where clauses in document databases.

Query

{
    "query" : "from VehicleWeatherData vwd select vwd.@id where vwd.VIN>12 && vwd.VIN<222"
}

or

{
    "query" : "from VehicleWeatherData vwd select vwd.@id where vwd.VIN==125 && vwd.temperature <= 4.0"
}

Model

entity VehicleWeatherData {
    VIN: int
    timeStamp : datetime
    vehicle_position : point
    temperature: float
    rain_Intensity: float
    solar_Intensity: int
}

documentdb DocumentDB {
    collections {
        vehicleWeatherData : VehicleWeatherData 
    }
}

Expected behavior

We expect the execution of the query to return a result set (empty or non-empty depending on the clauses values/data in the DB). Instead we receive a 500 server error message.

REST API

If the bug happens when calling the REST API:

Additional context

This affects VW use case.

tvdstorm commented 3 years ago

Can you try , instead of &&?

barmpis commented 3 years ago

thank you that works

zolotas4 commented 3 years ago

Just a follow up: , works on both relational and document as AND which is good. But what about OR ? || works on relational but does not work on document. Is there another symbol for OR (like ,) that works for both?

tvdstorm commented 3 years ago

Both are now supported directly on MongoDB (as per b6eea37f)