Use below command to build and load initial data to inventory collections.. There must be 8 documents in this collection. Run below command from command shell but show the result by taking screen shot from MongoDB Atlas You can use any of your existing database to build this collection under or simply write a command like use DBName to build a new Database and switch. then run below command to build collection. db.inventory.insertMany( [ { item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" }, { item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "P" }, { item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" }, { item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" }, { item: "specialcard ", qty: 77, size: { h: 22.85, w: 30, uom: "cm" }, status: "A" }, { item: "christmascard ", qty: 65, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" }, { item: "mothersdaycard", qty: 25, size: { h: 21.85, w: 30, uom: "cm" }, status: "D" }, { item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }, ] ); 2.Use find command to search documents where quantity (qty) in between 40 and 80. (>=40 and <=80)
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Use below command to build and load initial data to inventory collections.. There must be 8 documents in this collection. Run below command from command shell but show the result by taking screen shot from MongoDB Atlas
You can use any of your existing
db.inventory.insertMany( [
{ item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" },
{ item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "P" },
{ item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" },
{ item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
{ item: "specialcard ", qty: 77, size: { h: 22.85, w: 30, uom: "cm" }, status: "A" },
{ item: "christmascard ", qty: 65, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
{ item: "mothersdaycard", qty: 25, size: { h: 21.85, w: 30, uom: "cm" }, status: "D" },
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" },
] );
2.Use find command to search documents where quantity (qty) in between 40 and 80.
(>=40 and <=80)
Step by step
Solved in 2 steps with 3 images