Next.js Discord

Discord Forum

Nextjs Database/server events

Unanswered
Wood Duck posted this in #help-forum
Open in Discord
Wood DuckOP
I am new to Nextjs & have a specific requirement, need to trigger a server function on database(MongoDB) events like create, update, and delete the document or any other action-based event.
example: in an e-commerce app when an order is created send confirmation emails to the customer, vendor, and admin & perform some other server functions but don't want to do this in the main order "server action" or "API" because this may increase response time at the user side, I want to keep this kind of secondary function separately
can anyone help how I can achieve this, thanks in advance

0 Replies