pfitzpaddy / ngm-reportDesk

The workdesk for ReportHub
1 stars 6 forks source link

Bugfix: Adding location #332

Closed pfitzpaddy closed 4 years ago

pfitzpaddy commented 4 years ago

Errors in cascading locations – For example if we enter data for 3 “Woreda” in Oromia region, Reporthub automatically puts Oromia for a Woreda in Somali region.

pfitzpaddy commented 4 years ago

Updating site_id to string

db.getCollection('adminsites').find({ admin0pcode:'ET' }).forEach(function(d){
    d.site_id = d.site_id.toString()
    db.getCollection('adminsites').save(d)
})
pfitzpaddy commented 4 years ago

Make indexes on getAdminSites

db.getCollection('adminsites').createIndex({ admin0pcode: 1 });
db.getCollection('adminsites').createIndex({ admin0pcode: 1, admin1pcode: 1 });
db.getCollection('adminsites').createIndex({ admin0pcode: 1, admin1pcode: 1, admin2pcode: 1 });
db.getCollection('adminsites').createIndex({ admin0pcode: 1, admin1pcode: 1, admin2pcode: 1 , admin3pcode: 1 });
db.getCollection('adminsites').createIndex({ admin0pcode: 1, admin1pcode: 1, admin2pcode: 1 , admin3pcode: 1, admin4pcode: 1 });
db.getCollection('adminsites').createIndex({ admin0pcode: 1, admin1pcode: 1, admin2pcode: 1 , admin3pcode: 1, admin4pcode: 1, admin5pcode: 1 });
pfitzpaddy commented 4 years ago

Adding a location is now updated to fresh new look, also fixing errors

rh_et_add_new
pfitzpaddy commented 4 years ago

Adding indexes for all admin levels

db.getCollection('admin1').createIndex({ admin0pcode: 1 });
db.getCollection('admin2').createIndex({ admin0pcode: 1 });
db.getCollection('admin3').createIndex({ admin0pcode: 1 });
db.getCollection('admin4').createIndex({ admin0pcode: 1 });
db.getCollection('admin5').createIndex({ admin0pcode: 1 });