Need to write script for MongoDB collections
Budget: $30 – $250 CAD
I have four collection
CollegeLocation -- Json format
{
"MDTC": {
"collegeName": "College of Medicine - Tucson",
"1002": 10,
"1001": 234
},
"SCNC": {
"collegeName": "College of Science",
"1002": 24,
"1003": 21,
"1001": 16
},
"LAWC": {
"collegeName": "James E Rogers College of Law",
"1002": 234,
"1003": 213
}
}
LocationEmployeeDetails -- Json format
{
"1002": {
"loc_id": "1002",
"kmapids": [
"palmerjo",
"cwesterl",
"lumbee"
]
},
"1001": {
"loc_id": "1001",
"kmapids": [
"skaib",
"dcorso",
"ghuck",
"macmccallum"
]
},
"1003": {
"loc_id": "1003",
"kmapids": [
"ghuck",
"cwesterl",
"dcorso",
"witte",
"lumbee"
]
}
}
LocationDetails - json
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
32.0,
49.0
]
},
"properties": {
"country": "Ukraine",
"city": "",
"name": "Ukraine",
"state": "",
"loc_id": "1001"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-4.0,
40.0
]
},
"properties": {
"country": "Spain",
"city": "",
"name": "Spain",
"state": "",
"loc_id": "1002"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-73.087749,
41.6032207
]
},
"properties": {
"country": "United States",
"city": "",
"name": "Connecticut",
"state": "Connecticut",
"loc_id": "1003"
}
}
]
}
EmployeeDetails - csv
name kmapId college fullname collegeid
J Palmer palmerjo College of Medicine - Tucson John Palmer MDTC
C Westerland cwesterl College of Social and Behav Sci Chad Westerland SBSC
R Williams lumbee James E Rogers College of Law Robert Williams LAWC
S Kaib skaib College of Medicine - Phoenix Susan Kaib MDPX
M Witte witte College of Medicine - Tucson Marlys Witte MDTC
S Dougherty shonad College of Medicine - Tucson Shona Dougherty MDTC
D Corso dcorso College of Fine Arts Dawn Corso FNRT
G Huckleberry ghuck College of Science Gary Huckleberry SCNC
D Mccallum macmccallum James E Rogers College of Law David Mccallum LAWC
- `location_details.json`: contains locations details with location id `loc_id`
- `location_employee_details.json`: contains a list of the employees (`kmapids`) associated with each location.
- `employee_details.csv`: contains employees `kmapid`, `name`, and `college`
- `colleges_location_values.json`: contains college values for each location.
- `sample_output.json`: example of output format
Qustion 1 - How to Write a script to import `location_details.json`, `location_employee_details.json`, `employee_details.csv`, and `colleges_location_values.json` to a `MongoDB` database.
Question 2 - How to Write a script to read the data from the `MongoDB` database and produce a `JSON` file as the given format `sample_output.json`. The code should work for the variable length of data.
CollegeLocation -- Json format
{
"MDTC": {
"collegeName": "College of Medicine - Tucson",
"1002": 10,
"1001": 234
},
"SCNC": {
"collegeName": "College of Science",
"1002": 24,
"1003": 21,
"1001": 16
},
"LAWC": {
"collegeName": "James E Rogers College of Law",
"1002": 234,
"1003": 213
}
}
LocationEmployeeDetails -- Json format
{
"1002": {
"loc_id": "1002",
"kmapids": [
"palmerjo",
"cwesterl",
"lumbee"
]
},
"1001": {
"loc_id": "1001",
"kmapids": [
"skaib",
"dcorso",
"ghuck",
"macmccallum"
]
},
"1003": {
"loc_id": "1003",
"kmapids": [
"ghuck",
"cwesterl",
"dcorso",
"witte",
"lumbee"
]
}
}
LocationDetails - json
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
32.0,
49.0
]
},
"properties": {
"country": "Ukraine",
"city": "",
"name": "Ukraine",
"state": "",
"loc_id": "1001"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-4.0,
40.0
]
},
"properties": {
"country": "Spain",
"city": "",
"name": "Spain",
"state": "",
"loc_id": "1002"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-73.087749,
41.6032207
]
},
"properties": {
"country": "United States",
"city": "",
"name": "Connecticut",
"state": "Connecticut",
"loc_id": "1003"
}
}
]
}
EmployeeDetails - csv
name kmapId college fullname collegeid
J Palmer palmerjo College of Medicine - Tucson John Palmer MDTC
C Westerland cwesterl College of Social and Behav Sci Chad Westerland SBSC
R Williams lumbee James E Rogers College of Law Robert Williams LAWC
S Kaib skaib College of Medicine - Phoenix Susan Kaib MDPX
M Witte witte College of Medicine - Tucson Marlys Witte MDTC
S Dougherty shonad College of Medicine - Tucson Shona Dougherty MDTC
D Corso dcorso College of Fine Arts Dawn Corso FNRT
G Huckleberry ghuck College of Science Gary Huckleberry SCNC
D Mccallum macmccallum James E Rogers College of Law David Mccallum LAWC
- `location_details.json`: contains locations details with location id `loc_id`
- `location_employee_details.json`: contains a list of the employees (`kmapids`) associated with each location.
- `employee_details.csv`: contains employees `kmapid`, `name`, and `college`
- `colleges_location_values.json`: contains college values for each location.
- `sample_output.json`: example of output format
Qustion 1 - How to Write a script to import `location_details.json`, `location_employee_details.json`, `employee_details.csv`, and `colleges_location_values.json` to a `MongoDB` database.
Question 2 - How to Write a script to read the data from the `MongoDB` database and produce a `JSON` file as the given format `sample_output.json`. The code should work for the variable length of data.
Related categories:
MongoDB