suppose we have the following json data
var example = [{
latitude: 11.1111,
longitude: 111.111,
name: "for example1",
altitude: 88
},
{
latitude: 22.2222,
longitude: 222.222,
name: "for example2",
altitude: 89
},
{
latitude: 33.3333,
longitude: 333.333,
name: "for example3",
altitude: 90
}
]
I want to get the lists(or object) that has only latitude and longitude data, because Map API in my
react-native application require them. and by some performance issues, I can’t use loop.
I know that writing a separate query(MySQL) can solve this problem, but I don’t think this is good solution. (If not, I will very grateful if you can tell me)
thank you for reading this, how can I solve this?
4
Answers
I think you need this. it returns a new array with only lat/long items in objects
Would it be satisfied with an iterator?
[edit]
I think you are trying to save all filtered data to your database. Am I right? If it is then you can map or loop the data first in this way ->
And then insert bulk to MySQL database. Like this way ->