Question: Select All Documents in a Collection Selects from the inventory collection db . inventory.find ( { } ) In SQL: SELECT * FROM inventory To
Select All Documents in a Collection
Selects from the inventory collection db inventory.find
In SQL: SELECT FROM inventory
To specify equality conditions, use : expressions
Selects from the inventory collection all documents where the status equals D dbinventory.find status: D
In SQL: SELECT FROM inventory WHERE status D
Selects from the inventory collection all documents where the status equals either A or D: dbinventory.find status: $in: AD
In SQL: SELECT FROM inventory WHERE status in AD
Specify AND, OR Conditions
All documents in the inventory collection where the status equals A and qty is : dbinventory.find status: A qty:
In SQL: SELECT FROM inventory WHERE status A AND qty
All documents in the inventory collection where the status equals A or qty is : dbinventory.find $or: status: A qty: In SQL: SELECT FROM inventory WHERE status A OR qty
Use the limit function to specify the maximum desired number of results. dbinventory.findlimit
SELECT top FROM inventory
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
