I am building an real time application website that displaying the data from mongodb using Mongoose, I had a backend nodejs system to update the database frequently, and my current approach is to query the database every second, after doing some filtering and calculation, then display to the frontend.
Is there any way to open an websocket or any feature in alias can help me reduce the amount of request while fetching the database frequently like every second, to get the update of the current values in Mongodb?
If I understand your Use-Case correctly you want to display Updates to Documents within your Database
made by your Node.js backend directly inside your Application.
You could use the changeStream Feature for that. Inside your Application you can listen on multiple Collections for changes and display them accordingly.