Best way to search through GeoPoints and only return one GeoPoint for each metadata key

I create a new GeoPoint every time a user’s location changes. I add metadata unique to the user. The result is a table that includes many hundreds of multiple GeoPoints with different locations but same metadata. There will never be two users with the same metadata.

I search in a radius for GeoPoints and want only the most recent “update” of a user’s location, ignoring any other older GeoPoint with the same metadata. The point of this is to create an array of one single, up-to-date GeoPoint for each unique user.

What is the best way to do this?

Right now I am considering adding a filter method that would go through my returned BackendlessCollection and get the first GeoPoint, then add the metadata information to an array. I would check against this array for every GeoPoint in the collection, ignoring any that are older than those in the array, and adding to it each new unique metadata it comes across.

Is it intentional that a new geopoint is created? Would you be better off updating an existing geopoint instead? That may simplify the lookup when you need to retrieve the most recently updated one.


Yes, it is intentional, however I will take your advice and just update one geopoint instead of trying to deal with the extra work that comes with having multiple geopoints representing the same object. I guess I just feel like I “need” to be prudent, but to what end?