Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need guidance on this mongodb query I've tried many variations but they did not work. I believe this query uses aggregate(). empeProject.js: *Note that coursehero

need guidance on this mongodb query 

I've tried many variations but they did not work. I believe this query uses aggregate().

imageimage

empeProject.js:

*Note that coursehero blocks emails so do replace "at" with the @ symbol.


db.empeProject.insert([ {  "Employee": [ { "empeId": "e001",       "fName": "James",       "lName": "Bond",   "email": "..d"at"hotmail.com",       "experience": [        "Database Design",        "SQL",        "Java" ]    },    { "empeId": "e002",        "fName": "Harry",        "lName": "Potter",        "experience": [        "Data Warehouse",        "SQL",        "Spark Scala",        "Java Scripts" ]    } ],  "Project": [ { "projectId": "p001",      "projectTitle": "Install MongoDB" },        {"projectId": "p002",      "projectTitle": "Install Oracle" },        {"projectId": "p003",      "projectTitle": "Install Hadoop" } ],  "EmployeeProject": [ {  "empeId": "e001",         "projectId": "p001",         "hoursWorked": 4 },     { "empeId": "e001",         "projectId": "p003",         "hoursWorked": 2 },     { "empeId": "e002",         "projectId": "p003",         "hoursWorked": 5 } ] } ] );

Aggregation and Data manipulations on BSON documents If you have not done it yet, start mongo client and connect to the MongoDB database server. Next, process a script file empeProject.js to insert BSON documents into a collection empeProject. Make yourself familiar with the contents of the collection. Use either a method find or a method aggregate ( available in MongoDB to write the implementations of the following queries. Implementation of each query is worth 1 mark.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Smith and Roberson Business Law

Authors: Richard A. Mann, Barry S. Roberts

15th Edition

1285141903, 1285141903, 9781285141909, 978-0538473637

More Books

Students also viewed these Databases questions

Question

Evaluate each logarithm to four decimal places. log 0.257

Answered: 1 week ago