Overview of My Submission
The main aim of this project is to fire an email to the user with an appropriate description when the time of the particular event (set by the user prior) is up.
Working
1.The events are stored in documents. Each event has keys
: description, time, processed, emailId.
Index is used to make query process fast
db. remindersList.createIndex({ processed: 1, date: 1 })
2.The time (in time
field) controls when the event will be fired. The scheduled trigger type is deployed which checks what event has been passed in regular intervals.
3.The event occurrence, email is fired to email id (in emailId
field) with description (in description
field). For sending email, I am using 3rd party dependency SendGrid
.
4.After the event is processed, the processed
field is set true, so that event is not fired again.
context.services.get("mongodb-atlas").db("reminders").collection("remindersList").updateOne({_id:id},{$set:{processed:true}})
Submission Category:
Choose Your Own Adventure
Atlas services used:
Atlas Database
Realm Triggers
Realm Functions
Link to Code
shivamarora1 / mongodb-realm
Email Reminder Service Mongo DB Realm application
Submission for MongoDB Atlashackathon
The main aim of this project is to fire an email to the user with an appropriate description when the time of the particular event (set by the user prior) is up.
Working
- The events are stored in documents. Each event has
keys
: description, time, processed, emailId.
Index is used to make query process fast
db. remindersList.createIndex({ processed: 1, date: 1 })
- The time (in
time
field) controls when the event will be fired. The scheduled trigger type is deployed which checks what event has been passed in regular intervals.
- The event occurrence, email is fired to email id (in
emailId
field) with description (indescription
field). For sending email, I am using 3rd party dependencySendGrid
.
- After the event is processed, the
processed
field is set true, so that event is not fired againcontext.services.get("mongodb-atlas").db("reminders").collection("remindersList").updateOne({_id:id},{$set:{processed:true}})
Submission Category:
Choose…
Top comments (0)