Applying aggregation to search MongoDB documents. If you have not done yet, start Mongo client and connect to the MongoDB database server. Next, process the script file subject.js to insert JSON documents into a collection Subject. 1) Find the total number of subjects. 2) Find the total number of subjects that have no prerequisite. 3) Find the total number of subjects that worth more than 3 credit points.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
1
2
3
4 "subject": {
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
♡2227EESEE
23
24
25
26
28
29
30
31
db. Subject.insert(
{
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
}
_id":ObjectId(),
"subCode":"CSCI103",
"subTitle":"Algorithm and Problem Solving",
"credit":3,
"type":"Core",
"assessments": [
}
{ "assessNum": 1,
"weight":10,
]
"assessType":"Assignment",
"description":"Problem Solving and Invariant" },
{ "assessNum": 2,
"weight":10,
1,
"book": [
"assessType":"Assignment",
"description":"Assignment 1 - Sorting and Seaarching, Linked List
{ "assessNum": 3,
"weight":10,
"assessType":"Assignment",
"description":"Assignment 2 Recursion, Trees, and Algorithmic S
{ "assessNum": 4,
"weight":10,
"assessType":"Test/Quiz",
"description":"Closed-book Class Test" },
{ "assessNum": 5,
"weight":60,
"assessType":"Examination",
"description": "Closed-book Final Examination" }
{ "ISBN":"13:978-0-13-231681-1",
"bookType":"textbook",
"bookTitle":"Introduction to the Design and Analysis of Algorithm
"edition":3,
"yearPub":2022,
"publisher": "Pearson",
"author": [ "Anany Levitin" ] },
{ "ISBN":"13:978-0-13-231681-1",
"bookType":"reference",
"edition":3,
"yearPub":2005,
"publisher": "Pearson",
"author": [ "B A Forouzan", "D S Malik", "M K Sen Thomson" ] }
Screenshot
to the band balance of Mar
Sintag - Frane dočan including data vers
Senady madanm to the head balance of Marthe
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
db. Subject.insert(
{
||
'_id":ObjectId(),
"subject": {
"subCode":"CSCI114",
"subTitle":"Procedural Programming",
"credit":3,
"type":"core",
"assessments": [
{ "assessNum": 1,
"weight":5,
"assessType":"Assignment",
"description":"Assignment 1 Basic Concepts: Sequential Designs'
{ "assignNum": 2,
"weight":5,
"assessType":"Assignment",
"description":"Assignment 2 - Control structures: Selection Desi
{ "assessNum": 3,
"weight":5,
"assessType":"Assignment",
"description":"Assignment 3
{ "assessNum": 4,
"weight":15,
],
"book": [
"assessType":"Test/Quiz",
"description":"Closed-book Class Test" },
{ "assessNum": 5,
"weight": 10,
"assessType":"Test/Quiz",
"description":"Laboratory Test" },
{ "assessNum": 6,
"weight": 10,
"assessType":"Test/Quiz",
Repetition Designs and Functions I'
"description": "Closed-book Class Test" },
{ "assessNum": 7,
"weight":50,
"assessType":"Examination",
"description": "Closed-book Final Examination" }
{ "ISBN":"13:978-1-133-52635-3",
"bookType":"reference",
"bookTitle":"C++ Programming - Program design including data str
"edition":6,
"yearPub":2013,
"publisher":"CENGAGE Learning",
"author": [ "Malik D_S" ] },
{ "ISBN":"13:978-0-273-75983-6",
"bookType":"reference",
"bookTitle":"Starting Out With C++: From Control Structures the
"edition":7,
Transcribed Image Text:1 2 3 4 "subject": { 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ♡2227EESEE 23 24 25 26 28 29 30 31 db. Subject.insert( { 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 } _id":ObjectId(), "subCode":"CSCI103", "subTitle":"Algorithm and Problem Solving", "credit":3, "type":"Core", "assessments": [ } { "assessNum": 1, "weight":10, ] "assessType":"Assignment", "description":"Problem Solving and Invariant" }, { "assessNum": 2, "weight":10, 1, "book": [ "assessType":"Assignment", "description":"Assignment 1 - Sorting and Seaarching, Linked List { "assessNum": 3, "weight":10, "assessType":"Assignment", "description":"Assignment 2 Recursion, Trees, and Algorithmic S { "assessNum": 4, "weight":10, "assessType":"Test/Quiz", "description":"Closed-book Class Test" }, { "assessNum": 5, "weight":60, "assessType":"Examination", "description": "Closed-book Final Examination" } { "ISBN":"13:978-0-13-231681-1", "bookType":"textbook", "bookTitle":"Introduction to the Design and Analysis of Algorithm "edition":3, "yearPub":2022, "publisher": "Pearson", "author": [ "Anany Levitin" ] }, { "ISBN":"13:978-0-13-231681-1", "bookType":"reference", "edition":3, "yearPub":2005, "publisher": "Pearson", "author": [ "B A Forouzan", "D S Malik", "M K Sen Thomson" ] } Screenshot to the band balance of Mar Sintag - Frane dočan including data vers Senady madanm to the head balance of Marthe 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 db. Subject.insert( { || '_id":ObjectId(), "subject": { "subCode":"CSCI114", "subTitle":"Procedural Programming", "credit":3, "type":"core", "assessments": [ { "assessNum": 1, "weight":5, "assessType":"Assignment", "description":"Assignment 1 Basic Concepts: Sequential Designs' { "assignNum": 2, "weight":5, "assessType":"Assignment", "description":"Assignment 2 - Control structures: Selection Desi { "assessNum": 3, "weight":5, "assessType":"Assignment", "description":"Assignment 3 { "assessNum": 4, "weight":15, ], "book": [ "assessType":"Test/Quiz", "description":"Closed-book Class Test" }, { "assessNum": 5, "weight": 10, "assessType":"Test/Quiz", "description":"Laboratory Test" }, { "assessNum": 6, "weight": 10, "assessType":"Test/Quiz", Repetition Designs and Functions I' "description": "Closed-book Class Test" }, { "assessNum": 7, "weight":50, "assessType":"Examination", "description": "Closed-book Final Examination" } { "ISBN":"13:978-1-133-52635-3", "bookType":"reference", "bookTitle":"C++ Programming - Program design including data str "edition":6, "yearPub":2013, "publisher":"CENGAGE Learning", "author": [ "Malik D_S" ] }, { "ISBN":"13:978-0-273-75983-6", "bookType":"reference", "bookTitle":"Starting Out With C++: From Control Structures the "edition":7,
Applying aggregation to search MongoDB documents.
If you have not done yet, start Mongo client and connect to the MongoDB database
server. Next, process the script file subject.js to insert JSON documents into a collection
Subject.
1)
2)
3)
4)
Find the total number of subjects.
Find the total number of subjects that have no prerequisite.
Find the total number of subjects that worth more than 3 credit points.
Find the subject title, subject type, and credit value of subject with the highest
credit value.
5) Find the subject title, subject type, and credit value of subjects with credit value
= 3. List the output in ascending order by subject title.
6) For each subject type, list the name of subject type and the total number of subject
which belong to the subject type.
Find the ISBN and title of books that was published in 2022.
Find the title, author, and type of books used for the subject CSCI235.
Find the ISBN, title of book and publisher of books that have at least two authors
and at most three authors.
7)
8)
9)
10) List the subject code, title of book and publisher of books. Sort the results by
subject code in ascending order, and the publisher in the descending order.
Process each query implemented and save each query together with its results in a
file solution3.lst. You can process the queries one by one and later copy the content of
Terminal window and paste it one by one into a file solution3.lst. The results of query
processing must be included into a file solution3. Ist in the same orders as the queries
listed above.
Transcribed Image Text:Applying aggregation to search MongoDB documents. If you have not done yet, start Mongo client and connect to the MongoDB database server. Next, process the script file subject.js to insert JSON documents into a collection Subject. 1) 2) 3) 4) Find the total number of subjects. Find the total number of subjects that have no prerequisite. Find the total number of subjects that worth more than 3 credit points. Find the subject title, subject type, and credit value of subject with the highest credit value. 5) Find the subject title, subject type, and credit value of subjects with credit value = 3. List the output in ascending order by subject title. 6) For each subject type, list the name of subject type and the total number of subject which belong to the subject type. Find the ISBN and title of books that was published in 2022. Find the title, author, and type of books used for the subject CSCI235. Find the ISBN, title of book and publisher of books that have at least two authors and at most three authors. 7) 8) 9) 10) List the subject code, title of book and publisher of books. Sort the results by subject code in ascending order, and the publisher in the descending order. Process each query implemented and save each query together with its results in a file solution3.lst. You can process the queries one by one and later copy the content of Terminal window and paste it one by one into a file solution3.lst. The results of query processing must be included into a file solution3. Ist in the same orders as the queries listed above.
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY