I need help to decide what way follow in order to modeling this data in mongodb -



I need help to decide what way follow in order to modeling this data in mongodb -

i have 3 entities, , inheritance following:

countries | - provinces | - cities

in denormalized (or embedded) construction following:

one illustration document countriescollection

{ name : "argentina", provinces : [ { name : "santa fe", cities : [ { name : "rosario", zipcode : 2000 }, { name : "other", zipcode : 3142 }, ... ] }, ... ] }

what going take city zipcode field (which going unique) , assign person document in order identify city. pain query cities structure, when want filter cities in search box.

the other thought (based on going work cities in mostly) separate entities collections , link every city document province 1 using province_id field (just saying).

what want not duplicate information. in case?

cheers!

mongodb

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -