Skip to content

Instantly share code, notes, and snippets.

@neumino
Last active August 29, 2015 14:14
Show Gist options
  • Save neumino/0916562008c620ba81c7 to your computer and use it in GitHub Desktop.
Save neumino/0916562008c620ba81c7 to your computer and use it in GitHub Desktop.
Pipe the changfeed of a table in the same table.
// Require the current branch [next] of rethinkdbdash (probably 1.16.5)
var r = require('rethinkdbdash')();
// Set up the infinite domino effect
r.table('test').changes()('new_val').without('id').toStream()
.on('error', handleError)
.pipe(r.table('test').toWritableStream())
.on('error', handleError);
// Start the domino effect
r.table('test').insert({"hello": "world"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment