Question

Use the embedding technique to design a single MongoDB document which contains the data below. Submit the design in JSON format.

TerritoryID Name France France France CustomerID 30103 29940 29923 Account Number 10-4020-000638 10-4020-000193 10-4020-00008

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Embedded documents are documents with schemas of their own that are part of other documents (as items within an array).

Territory: new Schema({

    territoryID: Number,

    Name: String

})

Customer: new Schema({

    CustomerID: Number,

    AccountNumber: String

})

Now Territory and Customer would be used as an array in the Order document as an embedded document.

Order:new Schema({

    customers:[Customer],

    territories:[Territory],

    OrderValue:Number

})

Add a comment
Know the answer?
Add Answer to:
Use the embedding technique to design a single MongoDB document which contains the data below. Submit...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PLEASE NOTE BEFORE YOU ANSWER. THIS IS NOT MYSQL, IT IS MONGODB. IF YOU DO NOT...

    PLEASE NOTE BEFORE YOU ANSWER. THIS IS NOT MYSQL, IT IS MONGODB. IF YOU DO NOT KNOW MANGODB, PLEASE DO NOT ANSWER THIS QUESTION. LEAVE IT FOR SOMEONE WHO KNOWS IT. PART 1 Create a collection that will hold the data in avgprice kwh state.json. This .json file contains the annual data from 1990-2012 on the average energy price per kilowatt hour (KwH) by state and provider type. Implement the following queries: 1. Print each document that has Oklahoma as...

  • Submit your answers as a single Word document to the Dropbox. Use the Leadership Matrix provided...

    Submit your answers as a single Word document to the Dropbox. Use the Leadership Matrix provided in the Content area of the course to complete the following: • Identify effective leadership traits. Search for 10 business leaders who exemplify the selected leadership traits. Identify the company and job title for each business leader. Include a description of how the leader exemplifies the leadership trait. Describe if the leadership trait inspires followership and why. This assignment seeks to expose you to...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • Design a class named BankAccount that contains: 1. A private int data field named accountId for...

    Design a class named BankAccount that contains: 1. A private int data field named accountId for the account. 2. A private double data field named accountBalance for the account (default 0). 3. A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate. 4. A private Date data field named dateCreated that stores the date when the account was created. 5. A private int data field named numberOfDeposits...

  • C++ design a class named Technician that contains private data members to store the following: -technician's...

    C++ design a class named Technician that contains private data members to store the following: -technician's name (a string) - number of service calls - total time of all service calls - average service call time the technician class should also have the following public member functions: - a constructor function that initializes all data members by obtaining their values from the users. with the exception of the average service call time which will be calculated as: total_time/number_of_call - a...

  • in java Account that contains: balance: double data field date: Date data field. Use Date class...

    in java Account that contains: balance: double data field date: Date data field. Use Date class from the java.util package accountNumber: long data field. You should generate this value randomly. The account number should be 9 digits long. You can you random method from java Math class. annuallnterestRate: double data field. customer: Customer data field. This is the other class that you will have to design. See description below. The accessor and mutator methods for balance, annuallnterestRate, date, and customer....

  • use java to design the application, the GUI should appear as in the picture shown ....

    use java to design the application, the GUI should appear as in the picture shown . Use java language: Requirements Document A local bank intends to install a new automated teller machine (ATM) to allow users (i.e., bank customers) to perform basic financial transactions. Each user can have only one account at the bank. ATM users should be able to view their account balance, withdraw cash (i.e., take money out of an account) and deposit funds (i.e., place money into...

  • Multiple Choice Which of the following is not a data validation technique? (a) The Round function...

    Multiple Choice Which of the following is not a data validation technique? (a) The Round function (b) Lookup fields (c) Default values (d) Input masks 6. When would you use the Date function (a) To display the current date (b) To display only the year from a date field (c) When doing math involving two date fields (d) To convert a value from a number into a date 2. Which of the following fields is least likely to be set...

  • secuirty 1. When digitally signing a document, which key do you use? A: Symmetric key B:...

    secuirty 1. When digitally signing a document, which key do you use? A: Symmetric key B: Public key C: Private Key D: Your house key 2. Which of the following protocols uses encryption? A: FTP B: Telnet C: SSH D: SMTP 3. What happens when rm is used to delete a file? A: Creates a new hardlink to the file B: Only removes the file pointer C: Removes file pointer and only writes over data D: Removes file pointer and...

  • Show all work. Write neatly,use extra paper if needed one single PDF document and upload on Blackboard. Please do not email. Save with the filename and circle answers. Scan all pages together into fo...

    Show all work. Write neatly,use extra paper if needed one single PDF document and upload on Blackboard. Please do not email. Save with the filename and circle answers. Scan all pages together into format yourname_HW1.pdr. This assignment contains 5 questions on two pages. Use the definition of the Gini Index to show G-2 1. (x-L(x))dx where L(x) is the Lorenz curve. Show work to derive this formula. 2. The following table gives points on the Lorenz curve for the U.S....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT