Hello @Eric_Juvet,
Well, I think it’s basic to create a function and endpoint in node.js you can learn this from any AI tools and online node.js resources that are freely available in the market.
Related to the MongoDB question, how to delete duplicates? Depending on your actual requirement, how you want to detect the duplicates and delete them. You need to provide more information otherwise we can’t predict what you want and what issues you are facing.
You can refer to this topic, you will get an idea, and for more example topics you can search specific keywords here.