How to get real time updates from database

Skip to first unread message

Dhananjay Mangela

Sep 24, 2020, 8:00:03 AM9/24/20
to RethinkDB
I m using node.js with rethink db.
how can i achieved real time updates from database

Johannes Hillert

Sep 24, 2020, 1:08:27 PM9/24/20
to RethinkDB
You can use the 'changes' command to get notifications when something changes on the DB side..

Dhananjay Mangela

Sep 25, 2020, 2:14:18 AM9/25/20
how can i also update front end with changes in database ?

You received this message because you are subscribed to the Google Groups "RethinkDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Johannes Hillert

Sep 25, 2020, 4:05:02 AM9/25/20
to RethinkDB
Yes, you can update your frontend when 'changes' emits a new value.

I never used the JavaScript API of RethinkDB, but it looks like an observable. Judging from the examples on the page, I'd say it runs like this:

r.table('games').get(1).filter(r.row('score').gt(10)).changes().run(conn, (err, cursor) => {
// A change in the DB was made -> update frontend

With the callback method to your update method as 2nd parameter of 'run'.

Kind regards,
Reply all
Reply to author
0 new messages