in my code i have following console logs:
console.log(JSON.stringify(department.locationFilter, null, 2));
console.log(JSON.stringify(department.locationFilter.geoLocation, null, 2));
The first log results in:
{
"city": "Stuttgart",
"radius": 50,
"geoLocation": {
"type": "Point",
"coordinates": [
9.1800132,
48.7784485
]
}
}
The second log results in:
undefined
When i log "geoLocation" in department.locationFilter it also results in false.
I don't understand why the geoLocation is undefined because it exists inside the JSON object.
For some more information, the department is read from mongodb.
department = department.toObject()then try againgeoLocationhave any invisible whitespace characters?geoLocationavailable in all records?