1) How to improve performance?
2) PATCH (Partial Update):PUT (Replace or Full Update):
3) Do you know what is Database Indexes ? Database Primary Index have only one / Secondary Index
4) Concept of middleware in Express.js
execute code during the request-response cycle. Middleware functions have access to the request
object (req
), the response
object (res
), and the next
function in the application's request-response cycle.
They can perform tasks, modify the request or response objects, and either terminate the cycle or pass control to the next middleware function by invoking the next
function.
Middleware functions in Express.js can be used for various purposes, such as logging, authentication, handling errors, modifying the request or response, and more.
5) What is the purpose of the async
and await
keywords in Node.js?
- Answer:
async
andawait
are used to work with Promises in a more synchronous style. Theasync
keyword is used to declare an asynchronous function, andawait
is used inside an async function to pause execution until the Promise is resolved.