How to Send Firebase Cloud Massage using Database Trigger and MongoDB Functions

I want full code by using which i can send firebase cloud massage with data from document in massage.
When Data is inserted i want to send FCM to all users of my app.
Eg. if any user inserts a request for something then i want to send notifications to all user about it with his request data from mongodb document.