i’ve a question that breaks my head;
i’ll make an e-commerce site using MongoDB and Python (Tornado), and i’ll use the GIS to suggests some products to users near that region, and i’ve a lot of cities, for exalmpe, a departement X will have Y cities, i’ll use Javascript to hide the other cities when the user choses a departement; and every city, i’ve got their coordinates using google maps (really a headache), and those coordinates will not be seen by users, it’s only used for products suggestions, so here is my problem:
- bezcause i’ll use only one collection in mongodb, i’ll nest documents (user profil and cart) because i’ll not let them modify their profile, it’s an ecommerce after all, so to trust people, i’ll try to let them “have only one personality” maybe they can delete and create another one, but this, it’s another problem.
and because of that, i dont want to create another collection of cities, so can i make another tip to handle the coordinates to let them be tied to each city? for exemple if a person chooses that he lives in Algiers (Algeria), he will get directly (Lat, Long) coordinates that i’ve already saved from internet, if i’ll use “elif”, this will make a lot of time to process all that data (approximatively 300 cities), and what about using a separate json file that contains a departement, a city, and its coordinates?
Have you considered a dictionary?
Seems like an easier way of doing this.