Review the MongoDBdocumentation-https://docs.mongodb.com/manual/tutorial/query-documents/1.Create a query to find all objects where the Root.ExpenseItem.Amount is equal to...










Review the MongoDB











documentation









-







https://docs.mongodb.com/manual/tutorial/query-documents/























1.











Create a query to find all objects where the Root.ExpenseItem.Amount is equal to “200”, and 200.





































screenshot and paste your results









































2.











Create a query to find all objects where the Amount is “300”, 300.





































screenshot and paste your results












































3.











Rewrite your query above to make use of a combination of the “aggregate”, “match”, “find”, “unwind”, and “project” features of the query language to produce

a query that returns just the name of the person and the particular expense item details for the item that actually match the value “200”.


(Make sure you project the data so that other expense items are not included.)














screenshot and paste your results
































CST2355 – Database Systems: Assignment 1 CST8276 - Advanced Database Topics Lab 5 - Working with NoSQL Databases - MongoDB (5%) This assignment relates to the following Course Learning Requirements: CLR 2 - Administer a DBMS using knowledge of SQL, database security features, globalization, and database architecture (storage, memory, and processes) CLR 7 - Explore and gain practical experience in current advanced database technology Objectives of the Lab This lab is the first of two that address the larger theme of NoSQL databases. It focuses on installing and becoming somewhat familiar with the MongoDB document database. Background: Review the materials provided for the MongoDB to familiarize yourself. Assignment 2 asked you to install the MongoDB software. MongoDB is very appropriate for use in situations where the data in a collection consists of documents that have different fields within them. The individual “records” that would normally be stored as separate rows in a relational database table are stored as separate documents in the collection. Because MongoDB allows each document in a collection to have different rows, it is as if the rows are written with slightly different schemas; almost an “is-a” relationship in a type of hierarchy. This would be equivalent to trying to merge multiple tables consisting of rows that have different fields in each of the source tables. Such data does not fit the normalized relational database model. MongoDB supports the idea that even if you know your data schema today, you may not know the data in the future, and are likely to want to execute searches and/or queries against the disparate data in your collections. Deliverable: All Lab Submissions are to be submitted via Brightspace in a WORD file format. It is easiest to just submit the downloaded version of this Word document and paste your screenshots and answers into the spaces provided. Lab Submission Tasks: 1. List some of the main differences between the community server version and the enterprise server version of MongoDB….type your answer into the box below The enterprise server version of MongoDB has more features designed to help manage and secure data, including an in-memory storage engine and encryption for data at rest. 2. Create a new database with database name “CST8276” and collection name FirstExample” (e.g., FirstExample). On the sidebar menu, click on the new database to view the contents. Then on the main menu, select “View, Toggle Dev Tools” to see the development tool window panes. screenshot and paste your results 3. Create a file “tiny.json” using Notepad containing the following { "type": "home", "number": "212-555-1234" } { "type": "cell", "number": "646-555-4567" } { "type": "office", "number": "202-555-0182"} You will now import these three documents into your MongoDB collection. 4. In the MonoDB Compass Community tool, select the Collection > Import from the menu bar. Import your tiny.json file. Take a screen shot showing your CST876.FirstExample collection containing the three new documents. -- screenshot and paste your results Read the blog post: https://www.mongodb.com/blog/post/why-xml-in-rdbms-is-not-mongodb 5. Find a xml conversion tool via internet and convert the EMPLOYEE_EXPENSE_XML file supplied in BrightSpace to a JSON file. Save the output of the tool to “sample3.json” screenshot and paste your results 6. Navigate in MongoDB Compass to your collection. Click the refresh icon to ensure your list of objects in the collection is correct. Select the LIST option (Not TABLE) and then Click on the new document “Root”. Expand the content by clicking on each item to show the EmployeeInfo and several of the ExpenseItem array objects. screenshot and paste your results 7. Is the structure what you expected? Why? Explain the structure you see…. This structure is what I expected because I knew that it would be easier to work with because you can see that the data in the tiny.json file is more complex and it has subsections. The structure that I see has information on the employee and expenses items showing the dates, descriptions, and amounts. Review the MongoDB documentation - https://docs.mongodb.com/manual/tutorial/query-documents/ 8. Create a query to find all objects where the Root.ExpenseItem.Amount is equal to “200”, and 200. screenshot and paste your results 9. Create a query to find all objects where the Amount is “300”, 300. screenshot and paste your results 10. Rewrite your query above to make use of a combination of the “aggregate”, “match”, “find”, “unwind”, and “project” features of the query language to produce a query that returns just the name of the person and the particular expense item details for the item that actually match the value “200”. (Make sure you project the data so that other expense items are not included.) – screenshot and paste your results Please note: Algonquin College has a policy regarding Plagiarism. The consequences are immediate zeroes for assignments and potentially an instant fail for the whole course. It is only natural for students to work together to complete assignments. DO NOT PLAGIARIZE each other’s work. Table 1 - Lab 5 Grading Rubric Accomplished Developing Incomplete Criteria 3 0.5 0 Question 1 Completed ALL instructions AND Provided all correct answers Completed ALL instructions correctly but yielded incorrect answers OR Demonstrated complete understanding of the concepts using incorrect terminology OR Demonstrated partial understanding of the concepts using correct terminology Didn't follow ALL instructions OR Provided no answers OR Provided completely incorrect answers Question 2 refer to above refer to above refer to above Question 3 refer to above refer to above refer to above Question 4 refer to above refer to above refer to above Question 5 refer to above refer to above refer to above Question 6 refer to above refer to above refer to above Question 7 refer to above refer to above refer to above Question 8 refer to above refer to above refer to above Question 9 refer to above refer to above refer to above Question 10 refer to above refer to above refer to above End of Lab 1
Feb 13, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here