Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 2 (2.0 marks) Implement the following data manipulations on a collection of documents transport. (1) Remove a mechanic John Fox. (2) Remove information
Task 2 (2.0 marks) Implement the following data manipulations on a collection of documents transport. (1) Remove a mechanic John Fox. (2) Remove information about a date of birth (dob) from a description of employee number 11. (3) Remove information about a trip number 7 performed by an employee number 11. (4) Add information about a new trip performed by an employee number 11. At the moment we only know a trip number 999 and registration of truck used PKR786. (5) Change a date of a trip number 15 performed by an employee number 11 to 28- SEP-18. Implementation of each data manipulation is worth 0.4 mark. When ready create MongoDB script file solution2.js with the implementations of your data manipulations. Very important Implementation of each data manipulation must consist of the invocations of two methods: print(' (n) db.transport.data-manipulation-method ( data manipulation)'); db.transport.data-manipulation-method ( data manipulation ); where n is a number of a data manipulation as above, i.e. 1 or 2 or ... or 5. A method print () prints a text of a data manipulation into a report. A method data- manipulation-method processes a data manipulation and it includes the results into a report from the processing of a script solution2.js. Before generation of a report it is strongly recommended to "refresh" a collection of the documents transport with the methods db.transport.drop() and load ('transport.js'). Finally, to create a report open a Terminal window and at $ prompt process a script file solution2.js in the following way. mongo solution2.1st Deliverables A file solution2.1st with a report from processing of MongoDB script solution2.js with the implementation of the data manipulations listed above. A report without a listing of the processed data manipulations in a way explained above scores no marks. e# name dob address hireDate EMPLOYEE ID position [Driver, Mechanic] license status [Available, On-leave] DRIVER MECHANIC TRIP tripNumber ID registrationNum tripDate leg [1..*] ID make trip experience (Expert, Standard] TRUCK registrationNum ID capacity weight status maintain MAINTENACE registrationNum ID maintenancetime maintenanceDate
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here is the solution2js MongoDB script file with the implementations of the data manipulations print...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started