-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_insert_records.js
More file actions
35 lines (30 loc) · 1.14 KB
/
02_insert_records.js
File metadata and controls
35 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Provinces
db.Province.insertMany([
{provinceCode:"WC", name:"Western Cape"},
{provinceCode:"KZN", name:"KwaZulu-Natal"}
]);
// Municipalities
db.Municipality.insertMany([
{munCode:"CPT", name:"City of Cape Town", avgPopulation:4005016, provinceCode:"WC"},
{munCode:"ETH", name:"eThekwini Metropolitian Municipality", avgPopulation:3702231, provinceCode:"KZN"}
]);
// Facilities
db.Facility.insertMany([
{facilityid:"Arts", name:"Artscape Theatre Centre", address:"D.F. Malan St, Foreshore, Cape Town, 8001", capacity:1500, munCode:"CPT"},
{facilityid:"ICC", name:"Durban ICC", address:"45 Bram Fischer Rd, Durban Central, Durban, 4001", capacity:10000, munCode:"ETH"}
]);
// Rooms
db.Room.insertMany([
{roomNo: 1, description: "Hall 1", facilityId: "Arts"},
{roomNo: 2, description: "Hall 2", facilityId: "ICC"}
]);
// Activities
db.Activity.insertMany([
{activityRef: "MUS01", name:"Music Concert"},
{activityRef: "EXH01", name:"Art Exhibition"}
]);
// Usage
db.USES.insertMany([
{facilityId: "Arts", activityRef: "MUS01", Date: new Date("2025-05-20")},
{facilityId: "ICC", activityRef: "EXH01", Date: new Date("2025-06-15")}
]);