Closed gqinami closed 8 years ago
@gqinami We already implemented a limit of 2500 sightings per API request, however that can easily be changed to 1000. @swathi-ssunder @vivek-sethia for the "flag" wether or not the data has been limited or not mongoDBs limit function does not give us this information. This means if it returns 1000 we would not know if the actual request did contain exactly 1000 by chance or if it was cut down. To mitigate that we could limit by 1001 and then if we receive 1001 we will remove the last one and set the "limit flag" to true, otherwise it will be false. Do you think this is the right approach?
Here's more from our discussion yesterday:
Since the app always shows a time range of sightings, it is best to cut off by time. You should keep the 1000 Pokemon closer to now and discard those farther in the past. In other words: Sort by time (more recent first) and cut off at 1000. (Or at 1001 for your trick :)
The idea is that if the user filters for Pokemon that are very rare, she can see them all. Should the user filter for all the Pokemon and also have the map zoomed out very far, she might not see them all, but she gets a warning and the shown Pokemon are more or less evenly distributed on the map.
MajorBreakfast (Project E)
@jonas-he - Right. If we want to know the total number of records, then we will either have to use a separate count query or maybe use an aggregate query with the limit. Rather, limiting by 1001 and making the inference seems to be better.
@MajorBreakfast yes, we already sort by time first (descending) and then limit :)
done, see #166
Hi @PokemonGoers/pokedata,
after the meeting today with @PokemonGoers/catch-em-all and @PokemonGoers/pokemap-2 we decided that we would like to get in the response no more than 1000 pokemons (sightings or predictions) because a higher number is not really useful for the user and is not visible to display in the map.
Also, when cutting the response, we would like to have also an indication that you already cut the data (like a flag or something in the response).
If you have any questions, please let us know.
Thanks, PokeMap1 team