Ported to use RethinkDB