Hi Guys, I am trying to create a map based on events, lets's consider an event. It contains a lot of field along with longitude and latitude (both are separate fields) , now while plotting it on map I am getting whole document data by using the following query
collecton.find({}, {"longitude": 1, "latitude": 1, "_id": 0})
this above query return a lot of data ,like
{
field1 : string,
field2 : string,
field3 : array ,
field4 : boolean'
longitude : "20.310650"
latitude: "20.310650"
createAt : etc
}
{
field1 : string,
field2 : string,
field3 : array ,
field4 : boolean'
longitude : "20.310650"
latitude: "20.310650"
createAt : etc
}
{
field1 : string,
field2 : string,
field3 : array ,
field4 : boolean'
longitude : "20.310650"
latitude: "20.310650"
createAt : etc
}
mapping over it isn't working as longitude field is expecting a string and if I map that return an array of objects same for latitude
Is there any way to fix this issue , I hope you understand the problem , if still need more clarification just ask ,