Actually when I sent the request from Postman I am able to get the status Okay-- 200. But getting the following error in the terminal. Can anyone please help.
Error :
(node:59320) UnhandledPromiseRejectionWarning: MongoExpiredSessionError: Cannot use a session that has ended
at applySession (D:\MERN Stack\MongoDB_Refresher\node_modules\mongodb\lib\sessions.js:632:16)
at Connection.command (D:\MERN Stack\MongoDB_Refresher\node_modules\mongodb\lib\cmap\connection.js:186:53)
at D:\MERN Stack\MongoDB_Refresher\node_modules\mongodb\lib\sdam\server.js:189:18
at Object.callback (D:\MERN Stack\MongoDB_Refresher\node_modules\mongodb\lib\cmap\connection_pool.js:267:13)
at processWaitQueue (D:\MERN Stack\MongoDB_Refresher\node_modules\mongodb\lib\cmap\connection_pool.js:448:29)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
(node:59320) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see Command-line API | Node.js v19.6.0 Documentation).