Enginio server does not support simple SQL query function



  • I created an OBJECT TYPE which hastwo propertries: type1 and type2.
    Then I created some OBJECTS which different values assigned totype1 and type2.
    Then I built some models in QML to query the data using the type1 and type2 as query parameters, so the each model should download the objects with the given certain values of type1 and type2.
    But all the models downloaded the same data, i.e. all objects with all values of type1 and type2, so the type1 and type2 parameters did not play any role. Isanything wrong with my QML code?

    Thanks! Look forward to your quick support!


  • cid:52:privileges:purge

    Can you show us the composed query or sample code?



  • Yes, Thanks! The follows are two models:

    EnginioModel {
    id: my_models_list_model
    client: enginioClient
    query: {
    "objectType": "objects.model_image",
    "type": "my",
    "include": {"par_file": {},
    "icon_image": {},
    "std_image": {},
    "warp_image": {},
    "warp_par_file": {}
    },
    "query" : { "par_file": { "$ne": null },
    "icon_image": { "$ne": null },
    "std_image": { "$ne": null },
    "warp_image": { "$ne": null },
    "warp_par_file": { "$ne": null }
    }
    }
    }

    EnginioModel {
    id: network_models_list_model
    client: enginioClient
    query: {
    "objectType": "objects.model_image",
    "type": "network",
    "include": {"par_file": {},
    "icon_image": {},
    "std_image": {},
    "warp_image": {},
    "warp_par_file": {}
    },
    "query" : { "par_file": { "$ne": null },
    "icon_image": { "$ne": null },
    "std_image": { "$ne": null },
    "warp_image": { "$ne": null },
    "warp_par_file": { "$ne": null }
    }
    }
    }

    The only difference in the queries of these two models are the "type" parameter, but these two models downloaded the same objects (all the objects which have "type" values equal to either "my" or "network").

    Thanks again for your quick help!



  • You need to move "type" property into "query" property:
    @{
    “objectType”: “objects.model_image”,
    “include”: ......
    “query” : { “type”: “network”, .... }
    }@



  • Thanks a lot! Your solution works!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.