This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QUERY 1 | |
db.products.find({productId: 33324}).explain("executionStats") | |
"executionTimeMillis" : 8566ms | |
OUTPUT: | |
{ "_id" : ObjectId("5ed4e2e9bbec0790d579108c"), "productId" : 33324, "productName" : "Megablock 05 Limited Edition", "price" : 198.99, "reviewCount" : 15, "rating" : 1.25, | |
"themeName" : "DC Super Heroes", "themeImageUrl" : "https://legofec.s3-us-west-1.amazonaws.com/themes/dc.png", | |
"featured" : "Hard to find", "chokingHazard" : "true", "productLimit" : 6, "availabilityOnline" : "true" } | |
QUERY 2 | |
db.availabilities.find({productId: 33324}).explain("executionStats") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Products Table Query: | |
SELECT * FROM products where productid = 879569; | |
(1 row) | |
Time: 1.960 ms | |
Product Table Query 2: | |
SELECT * FROM products where productid > 9999000 AND price > 200.00; | |
(303 rows) | |
Time: 4.214 ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ROUTER | |
const router = require('express').Router(); | |
const controller = require('./controller.js'); | |
router.get('/findAll', controller.get); | |
module.exports = router; | |
//CONTROLLER |