I have a question that breaks my head;
I will create an ecommerce site using MongoDB and Python (Tornado), and I will use GIS to suggest some products to users near that area, and I have a lot of cities For xmail, there will be Wi cities in a department X, I will use javascript to hide other cities when the user chooses a department; And every city, I have found their coordinates to use Google Maps (actually a headache), and those coordinates will not be seen by users, it is used only for products' suggestions, so this is my problem Is:
- Maybe I will use only one collection in Mongodb, I am nested documents (user profiles and cart) because I have them I will not modify my profile, it is an e-commerce after all, so to rely on people, I will try to "have only one personality" to remove them and make another, but this, This is another problem and because of this, I do not want to make another collection of cities, so can I make another tip to handle coordinates to connect to each city? For example, if a person chooses that he lives in Algiers (Algeria), he will direct (wave, long) to direct that I have already escaped the Internet, if I use "Alif", then It will take a lot of time to process all the data (estimated 300 cities), and what about using a different JSN file, a department, a city and its coordinates?
have you considered any dictionary?
"Houston" coordinates = {"Houston": (26.35, 57.12), "Las Vegas": (27.34, 35.23), etc ... coords = coordinates [city] / Code> It seems an easy way to do this.
Comments
Post a Comment