Looking for changes in db

Hello guys!
I want to look for changes in my db(when created new record, when record is updated and ect.), how I can do it?

This massively depends on the database you use and if it supports talking such events back to you.

If though your application is the only application talking to the database, you can send/distribute those events from the various context modules.

My app is not the only one that uses this db.
I’m using mongodb with mongodb_ecto adapter.

The mongodb library, which mongo_ecto uses, apparently supports streaming cursors but not change streams. Looks like that would need to be added, and that someone is already working on it and has submitted a WIP pull request

1 Like