Is it possible to somehow subscribe to ‘add to db’ event using Node.js? Database is currently populated via Ruby on Rails. Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
MongoDB wise
There’s an ongoing discussion about triggers on mongodb Jira.
But for now you’re stuck with storing auto-increment values alongside with your data, and using indexed queries to check if there’s anything new.
Rails wise
I’m assuming you’re using Mongoid. Use callbacks or observers to send messages to a fast capped collection / unix socket / whatever. Other ODMs shouldn’t be too different.