Geolocation query with $near doesn´t work within EnginioModel



  • Hi,
    When I do a query in the EDS dashboard to find nearst address from my current coordinate it works. The query return the address nearst from my current position inside the maximum distance defined. Like the example bellow:

    { "geoLocation": { "$near": [-23.574554, -46.603986], "$maxDistance": 0.01 } }

    "geoLocation" is an attribute of "geoloc" type inside my object "company".

    But when I use this query inside a EnginioModel in QML file or Node.js or C++ it doesn´t work. The query return the follow error: "undefined: {"message":"Internal server error"}". Like the snippets below:

    //Company Euginio Model
    EnginioModel {
    id: companyEnginioModel
    client: client
    query: {
    "objectType": "objects.company",
    "query" : {
    "geoLocation":{
    "quey" : {
    "geoLocation": {
    "$near": [-23.574554, -46.603986],
    "$maxDistance": 0.01
    }
    }
    }
    }
    }
    }

    What´s means this error? Someone can help me?

    Thanks in advance.



  • Sorry, I posted a wrong qml code for EnginioModel. The right snnipet code is :

    //Company Enginio Model
    EnginioModel {
          id: companyEnginioModel
          client: client
          query: {
                   "objectType": "objects.company",
                   "query" : {
                         "geoLocation":{
                              "$near": [-23.574554, -46.603986],
                              "$maxDistance": 0.01
                          }
                   }
           }
    }
    


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