0
votes

I am from MySQL so I design parse.com table like so

Vehicle | license, year, & pool_id
Pool | address & city_id
City | name

Pool_id in vehicle pointer to Pool, City_id in pool pointer to city.

In mySQL we can Join three table and use where clause.

In the relational queries docs says

--data-urlencode 'where={"post":{"__type":"Pointer","className":"Post","objectId":"8TOXdXf3tz"}}'

Which query relation 1 table based on object id

How I query to get vehicle where city name = "somecity"?

1

1 Answers

0
votes

In angularJS

var config = {
params: {
    where: {
        vehicle_year: "2013",
        pool_id: {
            $inQuery: {
                where: {
                    city_id: {
                        $inQuery: {
                            where: {
                                city_name: "Jakarta"
                            },
                            className: "city"                               
                        }

                    }
                    //pool_address: "JL. DEF"                       
                },
                className: "pool"                   
            }       
        },
        car_id: {
            $inQuery: {
                where: {
                    car_class_id: {
                        $inQuery: {
                            where: {
                                name: "Box"                                 
                            },
                            className: "car_class"                              
                        }
                    }                       
                },
                className: "car"                    
            }               
        }

    },
    include: 'pool_id.city_id,car_id.car_class_id',

},
headers: { 'X-Parse-Application-Id' : 'gMKfl1wDyk3m6I5x0IrIjJyI87sumz58' }  
};

then

$http.get('http://ip/parse/classname', config).then(function(response){
}, function(error){
});