Hi All,
I am having below schema entities and relationship for one of my use case.
type RiderDevice{
user_imei
}
type Vehicle {
car_number
}
type DriverDevice {
driver_imei
}
riderDevice: uid @reverse .
driverDevice: uid @reverse .
car_number: string@index(term) .
user_imei: string@index(term) .
driver_imei: string@index(term) .
Sample mutation payload:
{
"set": [{
"car_number": "S283CCR",
"original_car_category": "luxury_sedan",
"driverDevice": {
"driver_imei": "1350000000344461",
"riderDevice": {
"user_imei": "1350000000344462"
}
}
},
{
"car_number": "S283CCR",
"original_car_category": "luxury_sedan",
"driverDevice": {
"driver_imei": "1350000000344467",
"riderDevice": {
"user_imei": "1350000000344467"
}
}
},
{
"car_number": "S283CCR",
"original_car_category": "luxury_sedan",
"driverDevice": {
"driver_imei": "1350000000344478",
"riderDevice": {
"user_imei": "1350000000344467"
}
}
}
]
}
I am trying to find all DriverDevice where driver_imei used in RiderDevice as user_imei .
Query which i tried:
driverDevice(func:has(driver_imei)) {
driver_imei
riderDevice@filter(eq(driver_imei,user_imei)) {
user_imei
}
Thanks