Here user.location is indexed “geo”
{
var(func(uid(0x1))){
location as user.location
}
matches(func:near(user.location,location,100000)){
user.userName
}
}
Tried storing longitude and latitude as seperate values and then using them in the function, doesn’t work too:
{
var(func(uid(0x1))){
longitude as math(user.longitude)
latitude as math(user.latitude)
}
matches(func:near(user.location,[longitude,latitude],100000)) {
userId:uid
longitude:user.longitude
latitude:user.latitude
}
}
Is there any way to avoid passing longitude and latitude values directly:
{
matches(func:near(user.location,[7,9.0765],100000)) {
userId:uid
longitude:user.longitude
latitude:user.latitude
}
}