Notes on quick 1st round of remaining part of John Smilga Node Express tutorial (after Tasks project)
Last updated on 4 Oct. 2024 2 & 3 Oct. 2024: Continuing from after Tasks project in John Smilga Express tutorial...Node.js Projects, https://youtu.be/rltfdjcXjmk?t=11235 (from around 3 hrs, 7 mins in the video). The next project taken up is the Store project. express-async-errors, https://www.npmjs.com/package/express-async-errors Most of the source code of the Store project is straight-forward and somewhat similar to Tasks project. However, controllers\products.js has fair deal of complexity as it uses the various query features of Mongoose find() with Query String params being the mechanism for specifying the query to the get route ('routed' to getAllProducts() method in controllers\products.js file). The code for string data query is simple. Numeric data query code is complex which is covered below in some detail. Chaining the find method conditionally with sort and select methods, and unconditionally with skip and limit methods is new in the tutorial. The await keyword