MongoDB saves the necessary data to the collection, but outdated data goes to res()
Everything works fine, but the data I get in res() is one step behind. I rewrote the entire code a hundred times and no longer understand what the problem is here is part of the code backend on express.js, node.js…